Node-restify: TypeError: restify.queryParser is not a function

Created on 15 Jan 2018  路  3Comments  路  Source: restify/node-restify

app.use(restify.queryParser());
it was writed in finale Getting Started doc .
https://github.com/tommybananas/finale

The author of finale sad

:This is not a finale issue

https://github.com/tommybananas/finale/issues/7

Bug Report

Restify Version

"restify": "^6.3.4",

Node.js Version

~ node --version
v8.9.3

Expected behaviour

Actual behaviour

Code like this:
var restify = require('restify');
app = server = restify.createServer();
app.use(restify.queryParser());
app.use(restify.bodyParser());

get an error :
app.use(restify.queryParser());
^
TypeError: restify.queryParser is not a function
at Object. (/Users/xxxxxxx/sequelize/finale.js:34:17)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

Most helpful comment

Hi @anuxs, it has been moved under restify.plugins

const restify = require('restify');
app = restify.createServer();
app.use(restify.plugins.queryParser());
app.use(restify.plugins.bodyParser({ mapParams: false }));

All 3 comments

Hi @anuxs, it has been moved under restify.plugins

const restify = require('restify');
app = restify.createServer();
app.use(restify.plugins.queryParser());
app.use(restify.plugins.bodyParser({ mapParams: false }));

Thanks @sfaizanh!

Closing this issue as resolved :heart:

Many many thanks @sfaizanh

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danhstevens picture danhstevens  路  6Comments

domenic picture domenic  路  4Comments

stevehipwell picture stevehipwell  路  8Comments

nodesocket picture nodesocket  路  4Comments

RaghavendhraK picture RaghavendhraK  路  5Comments