How to parse/read multiple parameters with restify framework for Node.JS How to parse/read multiple parameters with restify framework for Node.JS node.js node.js

How to parse/read multiple parameters with restify framework for Node.JS


You just need to load the query parser plugin like so;

server.use(restify.plugins.queryParser());


Restify 5 (2017) answer:

As of restify 5 you can now setup the query parser like this:server.use(restify.plugins.queryParser());.

If you use this plugin you can access the parsed params in req.query.

For additional options and information, take a look into the restify documentation: http://restify.com/docs/plugins-api/#queryparser


Simon's answer is no longer valid as restify's queryParser has been moved to the restify-plugins package. The updated solution is

server.use(require('restify-plugins').queryParser());