node-restify
node-restify copied to clipboard
Multiple optional params with restify-router
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);
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?