Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Yannick Grenzinger
@ygrenzinger
thanks a lot :)
Guilherme Viebig
@viebig
hello all
is queryParser broke?
Paul Rumkin
@rumkin
This message was deleted
Pedro Montoto García
@McOmghall
Hello everyone, is there a simple way to add different verbs to the same named route? like
restify.get({name: 'name', path: 'path'}, /.../).post(/etc/)
Also, any way to make hierarchical routes (i.e. handlers for routes inside routes)
Cristian Lupu
@Khez
I noticed there are a lot of packages to create restify swagger docs, any recommendations ?
Cristian Lupu
@Khez
your silence says it all… I should roll my own… /not :shipit:
avimar
@avimar
@Khez I don't see much activity here, so no answer doesn't mean very much.
If you come across a nice doc'ing package that plugs into restify, please give me a shout.
Cristian Lupu
@Khez
@avimar there are actually quite a lot, but each have particularities that are not as plug and play as I want them to be
Finn
@nguyennb9
blob
I see the dependencies are out of date. Are there any problem with it?
nodecraic
@webworkio
hey, if anyone has any remote remote , designer, DevOps or Sysadmin jobs they can post them at http://webwork.io
Fagner Brack
@FagnerMartinsBrack
What are the node versions supported by restify (latest 4.0.4)?
Saleem
@zalym
hello, I am having an issue where too many connections are being opened and closed. How do I control the number of connections? Ideally I would like to have one connection to the server and then stream all requests through that connection
Victor Augusto
@augustovictor

Hello everyone.

I am looking for a someone's project to take a look at then I can follow the same project structure and patterns.

Thanks

Victor Augusto
@augustovictor
What's the best way to do something like this?
var mid = function(req, res, next) {
  models.Team.find({
      where: {
        id: req.params.id
      }
    }).then(team => {
      if (team) {
        req.team = team;
        return next();
      } else {
        res.send(404, 'Team not found');
      }
    }).catch(err => {
      send(500, err);
    });
};


// -----------------------------------------------

var getById = function(req, res, next) {
  mid(req, res, next);
  res.send(req.team);
  return next();
};
Maciej Ziehlke
@digitalmio
Hey all. Can you please advise me best oAuth2 server implementation (with SCOPES) for Express / Restify?
Yannick Grenzinger
@ygrenzinger
@digitalmio passport ? have you look at it ? seems the standard for server auth
@augustovictor Seems fine to me. Only put directly the res.send(req.team); line in the mid(...) function ... but I think there is no typical "project structure and patterns" with restify (or I have missed something)
Yannick Grenzinger
@ygrenzinger
BTW i'm a simple user of Restify. It could be better if the Restify team could answer the questions :)
Maciej Ziehlke
@digitalmio
@ygrenzinger Thanks, but Passport is a oAuth Client. I’m looking for server.
Johan Vaage
@Jovaage
I have a problem with mongoose.
When I try to return a validation error .send(400, err), to the client. The only thing that is sent through restify is
{
    "message": "User validation failed"
}
Even though the actuall object, err, is a much larger object
Muhammad Saqib
@segmentationfaulter
Does restify works with node version 6.0?
Justin Keller
@nodesocket
@segmentationfaulter I'm using it with Node 6.1. There is a warning being thrown from a depend package though, see issue restify/node-restify#1067
Says due to be fixed in the next release of restify.
whartman-ulabs
@whartman-ulabs

Hey there!
I am relatively new to using restify and had some questions on how to serve static files and not dork up the routes I have for my REST services.

server.get(/\/?.*/, restify.serveStatic({
    directory: 'static',
    default: 'index.html'
}));

This setup here conflicts with my other routes that are now unreachable:

server.get({path : SURVEY_QUESTION_PATH, version : appVersion}, getLandingSurveyQuestions);
How do I serve up static content at my root, but allow my GET routes to be accessible?
Yannick Grenzinger
@ygrenzinger
Hello @whartman-ulabs in my code, I first load the routes of the REST API
then i add this code:
server.get(/.*/, restify.serveStatic({
    directory: './app',
    default: 'index.html'
}));
whartman-ulabs
@whartman-ulabs
One way I have gotten around this is to change the regex pattern:
server.get(/(^\/$)|(\.(html|js|css|png|jpg|jpeg)$)/, restify.serveStatic({
  directory: 'static',
  default: 'index.html'
}));
Yannick Grenzinger
@ygrenzinger
hmmm .... mine seems a little bit simpler
sadly I can't share my code on public repo :(
whartman-ulabs
@whartman-ulabs
I agree
Let me give that a try
Yannick Grenzinger
@ygrenzinger
full code:
const routesToLoad = [
    'filesForRoutes.js',
    '....js'];
routesToLoad.forEach(function (curFile) {
    logger().debug('loading route: ' + curFile);
    const route = require('./routes/' + curFile);
    route.routes(server);
});

server.get(/.*/, restify.serveStatic({
    directory: './app',
    default: 'index-aiguillage.html'
}));
whartman-ulabs
@whartman-ulabs
My static content loads, but not my GET routes with that approach
server.get({path : SURVEY_QUESTION_PATH, version : appVersion}, getLandingSurveyQuestions);

server.get(/.*/, restify.serveStatic({ 
    directory: './static', 
    default: 'index.html' 
}));
Yannick Grenzinger
@ygrenzinger
And if you invert the 2 'get' ?
whartman-ulabs
@whartman-ulabs
Doesn't make a difference.
server.get(/.*/, restify.serveStatic({ 
    directory: './static', 
    default: 'index.html' 
}));

server.get({path : SURVEY_QUESTION_PATH, version : appVersion}, getLandingSurveyQuestions);
Yannick Grenzinger
@ygrenzinger
Then ... I have no ideas :(
sorry
Seems I met the same problem but no idea why it's working for me now and not yours
whartman-ulabs
@whartman-ulabs
NP. I'll stick with my hack for now. Thanks!