How to use the InternalServerError function from restify
Find comprehensive JavaScript restify.InternalServerError code examples handpicked from public code repositorys.
GitHub: diamondpkg/registry
77 78 79 80 81 82 83 84 85 86
router.post('/user', (req, res) => { if (!req.params.username || !req.params.password || !req.params.email) return res.send(new restify.BadRequestError('Missing username and/or password and/or email')); bcrypt.hash(req.params.password, 8, async (err, hash) => { if (err) return res.send(new restify.InternalServerError('Internal server error')); const existing = await User.findOne({ where: { $or: [
0
1
2
+ 7 other calls in file
GitHub: pglah/openSenseMap-API
252 253 254 255 256 257 258 259 260 261
next(new restify.NotAuthorizedError('ApiKey is invalid or missing')); }) .catch(function (err) { console.log(err); Honeybadger.notify(err); next(new restify.InternalServerError()); }); } else { next(new restify.NotAuthorizedError('ApiKey is invalid or missing')); }
36
0
0
restify.createServer is the most popular function in restify (1059 examples)