Skip to content

Instantly share code, notes, and snippets.

@iamkevingreen
Created December 11, 2017 10:55
Show Gist options
  • Save iamkevingreen/aa63954017eeca7e2a6151303fed9b5f to your computer and use it in GitHub Desktop.
Save iamkevingreen/aa63954017eeca7e2a6151303fed9b5f to your computer and use it in GitHub Desktop.
const { json } = require('micro')
const post = require('micro-post')
const updateBlog = require('./api/blog')
module.exports = post(async (req, res) => {
const parsed = await json(req)
switch (parsed.sys.contentType.sys.id) {
case 'blog':
updateBlog(parsed)
break
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment