Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
This gives me something... bunyan -c 'this.msg!="handled: 200"'
Evan Francis
hello, I've got a question about how restify handles routes. if a route handler is busy, does it wait for each previous request to complete before responding to the next? or is it supposed to all happen parallel?
@ejfrancis you mean if you have two requests to the same route? they happen in parallel. If you needed them to wait, that could probably be architected... e.g. a concurrency limit to some external API..
There any reason the audit logger isn't sending req.user to bunyan, that I set via middleware?
is has res so it's not like it's returning just the raw inbound information
and req.timers has the middleware I referenced...
avimar @avimar is confused
Oh. auditlogger builds req, not just passes it along. Doh.
not sure the best way to solve that.. I like the latency and timers and stuff.
how could I rpoxify some requests with restify?
Is there any way to prevent restify from augmenting the header keys?
Or maybe get some insight into why it does it?
Shahjada Talukdar

Guys , created a simple AUTH Server with Node.js Restify Redis Mongo


Please feel free to contribute and use!

hm... why no new messsages in here since August? Have ppl moved over to another forum?
I just checked the other listed forum thou ( Google Groups) and there where a total of 2 questions for the whole year of 2016
although stackoverflow question count for Looback and Restify are kind of similar, I must admit
@jgamedev would be weird since there's such an underlying difference.
Perhaps since restify is rather low level, there's not much "new" happening with it?
And most questions that apply to express work here, too.
is Netflix still using it?

Hi all

I am using knex and resitfy for my API server. I am trying to do the following

    id: tableId
    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
Can anyone give me some help with this?
Note that when I remove the catch, i don't get this warning
@FrikkieRetro pretty sure you need to return db....
@avimar I did think so as well initially, but I got the same error
Alex Liu
@jgamedev netflix is still using restify extensively
@DonutEspresso Thanks, I have read that as well. It does the same whether I am returning db or not. I have now reverted to just suppressing the warning on bluebird
Ganesh Majhi
i have created a restful service using java (spring) & added dependecies using maven.. and now i want it to connect with node.js .. Any help??
Nick Parsons
@aalimovs All good!
Hello, I'm new to Restify. is there anything special you have to do for customer headers? I tried res.header to define it there, under my server options.. do I need to specify it in more places?
@GeCremeans have you check the docs? http://restify.com/
What code did you try?
I did read through the documentation, I was trying to push a custom header with res.header, but I think I may not fully grasp how restify works for custom ones.
John MHM {freshnode}

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:


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' );
@playeren I'm not sure -- I don't see in the docs -- maybe it's req, res, next, err ?
John MHM {freshnode}
@avimar You mean I don't pass next as a arg in the function? I'll try that, thanks!
John MHM {freshnode}
@avimar Yeah that was the issue - thanks again!
Just wrote a prototype batch request handler and would welcome a code review... https://github.com/ValYouW/restify-batch-handler
Hello guys :D have a silly question I think restify might be listening on the wrong host ? Is there any way to specify this ? It binded to :: instead of localhost restify listening to http://[::]:3998
in ipv6 would be ::1 I think ?
Tri Nguyen
I am trying to use the serveStatic method like so:
server.get(/\/docs\/?.*/, restify.serveStatic({
    directory: './doc',
    default: 'index.html'
however, when I go to https://myapp.com/docs/, I get this error: {"code":"ResourceNotFound","message":"/docs/"}
I think this is because if I don't define 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 and directory combination will serve a file located in ./documentation/v1/docs/current/index.html when you attempt to hit http://localhost:8080/docs/current/.

does anyone know what I need to do to get the behavior that I wanted?
Emem Umoh
@tnguyen14 did you figure it out?
@ememumoh Hi.
Bruno Alexandre
guys, how can I call an endpoint from a function inside restify (so I can re-use the call instead of extracting everything to a method and call the method)
What is the correct way to catch and reformat errors?
Fernando Girotto