Last active
November 14, 2018 01:59
-
-
Save abhiaiyer91/2259b1eb96d0ec1ef6c1233926b31a06 to your computer and use it in GitHub Desktop.
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
/** rest of code above **/ | |
server.get("/post/:id", async (req, res) => { | |
const postId = req.params.id; | |
// Use the post API from prisma client | |
try { | |
const post = await prisma.post({ | |
id: postId | |
}); | |
return res.send(post).status(200); | |
} catch (e) { | |
console.error(e); | |
return res.sendStatus(500); | |
} | |
}); | |
/** rest of code below **/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment