node-restify icon indicating copy to clipboard operation
node-restify copied to clipboard

Multiple optional params with restify-router

Open gtoselli opened this issue 5 years ago • 1 comments

Hi, I have a problem with restify and restify-router. I have this route, which works correctly with express. I recently switched to restify and can't find a way to make it work.

const Router = require('restify-router').Router;
const router = new  Router();
const restify = require('restify');
const app = restify.createServer();
app.use(restify.plugins.queryParser());
app.use(restify.plugins.bodyParser({ mapParams: false }));
router.add('/:father_model/:father_id?/:child1_model?/:child1_id?/:child2_model?/:child2_id?/:child3_model?/:child3_id?/:child4_model?/:child4_id?', CrudRouter);
router.applyRoutes(app);

gtoselli avatar Mar 25 '19 11:03 gtoselli

Hi - I actually didn't know about restify-router, it's not something the core team owns. Would you mind checking with the author over in the restify-router repo?

DonutEspresso avatar Apr 20 '19 07:04 DonutEspresso