Instantly share code, notes, and snippets.

@iamfunsho /block5.js Secret
Created Oct 24, 2017

Embed
What would you like to do?
export let home = router.get("/", (req, res) => {
res.render("index", { title: "Chat Room" });
});
export let chatRoom = router.get("/chat/:username", (req, res) => {
res.render("room", { user: req.params.username });
});
export let messages = router.get("/messages", (req, res) => {
fetchMessages().then(messages => {
res.send(messages);
});
});
export let users = router.get("/users", (req, res) => {
fetchUsers().then(u => {
res.send(u);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment