Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Cosmic Blog tutorial - API endpoint for site metadata
// API endpoint for site metadata (i.e. title, tag, logo)
server.get('/api/meta', (req, res) => bucket.getObject({ slug: 'header' })
.then(object => res.send(object))
.catch(err => res.status(404).json({
message: 'Error fetching header data',
error: err,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment