Luiz Eduardo de Christo Luiz Eduardo de Christo - 1 year ago 191
Node.js Question

Express method-override in node.js

In a node application at server.js file, what is the difference between use:


or use:


Both of them works. I just want to know if there is any difference between.

Thanks in advance.

Answer Source

From the docs:

Essentially, it will retrieve your method override from the X-HTTP-Method-Override header by default. Specifying it makes no difference.

If you were to retrieve your method override from an alternative header, X-Foo-Bar, you would use app.use(methodOverride('X-Foo-Bar'));.

If you were to retrieve your method override from a query string, foo=PUT, you would omit the X- prefix, e.g. app.use(methodOverride('foo'));

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download