Skip to content

Instantly share code, notes, and snippets.

@chrisoverstreet
Created May 23, 2018 15:56
Show Gist options
  • Save chrisoverstreet/0a07ff8f33dad2d26cad8f3594775161 to your computer and use it in GitHub Desktop.
Save chrisoverstreet/0a07ff8f33dad2d26cad8f3594775161 to your computer and use it in GitHub Desktop.
Cosmic Blog tutorial - Social Links endpoint
// API endpoint for social links
server.get('/api/social-links', (req, res) => {
const params = {
type: 'social-links',
};
return bucket.getObjects(params)
.then(objects => res.send(objects))
.catch(err => res.status(404).json({
message: 'Error fetching social links',
error: err,
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment