How to use the NotFoundError function from restify
Find comprehensive JavaScript restify.NotFoundError code examples handpicked from public code repositorys.
53 54 55 56 57 58 59 60 61 62
employeeService.getPicture(req.user.email, employeeId, pictureType) .then(picture => { if (!picture || picture === '' || picture === null) { res.send(new restify.NotFoundError()); next(); } else { res.writeHead(200, { 'Content-Type': 'image/jpeg' }); res.end(picture);
69
95
21
GitHub: diamondpkg/registry
21 22 23 24 25 26 27 28 29
res.send(200, await utils.getAdvUserInfo(req.user)); }); router.get('/user/:name', async (req, res) => { const user = await User.findById(req.params.name); if (!user) return res.send(new restify.NotFoundError('Invalid user')); return res.send(200, await utils.getAdvUserInfo(user)); });
0
1
2
restify.createServer is the most popular function in restify (1059 examples)