Skip to content

Instantly share code, notes, and snippets.

@chrisoverstreet
Created May 23, 2018 15:56
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