Created
May 23, 2018 15:56
-
-
Save chrisoverstreet/0a07ff8f33dad2d26cad8f3594775161 to your computer and use it in GitHub Desktop.
Cosmic Blog tutorial - Social Links endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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