Created
February 19, 2021 19:53
-
-
Save dioscarey/ed1abc6b0761a13a52462af2b9641f68 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const postFunction = async (ctx) => { | |
try { | |
const {id} = ctx.req.body; | |
const r = await ctx.db.getData(id); | |
// This respond function is customizable in your middleware | |
ctx.respond(200, r); | |
} catch(err) { | |
console.log(err); | |
ctx.respond(500); | |
} | |
} | |
module.exports = postFunction; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment