Last active
March 1, 2020 11:54
-
-
Save dunnock/e2e0480e5aac08f33432962fec7cf1f1 to your computer and use it in GitHub Desktop.
actix-node-benchmark: JavaScript get_tasks handler
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
router.get('/tasks', (req, res, next) => { | |
let { assignee_name, summary, limit, full } = req.query; | |
full = full == "true"; | |
if (!!limit && isNaN(limit)) { | |
return next(createError({ | |
status: 400, | |
message: "limit query parameter should be a number" | |
})); | |
} | |
db.get_tasks(assignee_name, summary, limit, full) | |
.then(tasks => res.send(tasks)) | |
.catch(err => next(createError(err))) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment