Guys , created a simple AUTH Server with Node.js Restify Redis Mongo
https://github.com/clevox/clevox-auth
Please feel free to contribute and use!
Hi all
I am using knex and resitfy for my API server. I am trying to do the following
db('table').where({
id: tableId
})
.then(function(stuff){...})
.then(function(morestuff){...})
.catch(function(error){
res.send(400,{error.message});
return next();
}
I have an after function that runs to log traffic, so calling next() is always necessary. However, this block of code gives this warning
Warning: a promise was created in a handler at domain.js:300:12 but was not returned from it
Hi! Noob here playing around with restify. I have a simple restify app, and I wonder why server.on('after' always fires an err, even though nothing seems amiss?
Err obj:
{"methods":["GET"],"name":"get","params":{},"spec":{"path":{},"method":"GET","versions":[],"name":"get"}}
Server.on after snip:
server.on('after', function(req, res, err){
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress || req.socket.remoteAddress || req.connection.socket.remoteAddress;
let reqStr = req.toString(),
shortReqArr = reqStr.split('HTTP'),
shortReq = shortReqArr[0];
logga(timeDate() + ' 200: ' + shortReq + ' ip: ' + ip);
if (err) {
console.log(timeDate() + ' server after error ' + JSON.stringify(err) + ' \n' );
}
next();
});
https://myapp.com/docs/
, I get this error: {"code":"ResourceNotFound","message":"/docs/"}
file
in opts
, it defaults to directory
+ req.path
, which becomes doc/docs
this is not the desired behavior, and doesn't seem to be the behavior described in the documentation
The above
route
anddirectory
combination will serve a file located in./documentation/v1/docs/current/index.html
when you attempt to hithttp://localhost:8080/docs/current/
.