Last active
August 15, 2016 23:36
-
-
Save hnry/a79d7fa313de7d14657e0bf9de4b6e01 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
const get_user = (name) => { | |
return users.findOne({ name: name }) | |
} | |
const get_likes = (name) => { | |
// get user info | |
return get_user(name).then((user) => { | |
return likes.findAll({ id: user.id }) | |
}) | |
} | |
// can make them routes | |
const app = route.define([ | |
route.get("/api/user/:name", ["name"], get_user), | |
route.get("/api/likes/:name", ["name"], get_likes) | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment