Skip to content

Instantly share code, notes, and snippets.

@risenW
Created July 14, 2020 06:06
Show Gist options
  • Save risenW/5a12d04d051f84f49e3ce7714c5b54c7 to your computer and use it in GitHub Desktop.
Save risenW/5a12d04d051f84f49e3ce7714c5b54c7 to your computer and use it in GitHub Desktop.
app.get("/recommend", (req, res) => {
let userId = req.query.userId
if (Number(userId) > 53424 || Number(userId) < 0) {
res.send("User Id cannot be greater than 53,424 or less than 0!")
} else {
recs = model.recommend(userId)
.then((recs) => {
res.render("index", { recommendations: recs, forUser: true })
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment