Request objects

    • is now called req.pathParams

    • req.parameters is now called req.queryParams

    • req.params() is now called req.param()

    • req.requestType is now called req.method

    • req.compatibility is now called req.arangoVersion

    • req.user is now called req.arangoUser

    Some attributes have been removed or changed:

    • req.requestBody has been removed entirely (see below)

    • is now a string rather than an array

    Additionally the req.server and req.client attributes are no longer available. The information is now exposed in a way that can (optionally) transparently handle proxy forwarding headers:

    • req.hostname defaults to req.server.address

    • req.port defaults to req.server.port

    • req.remoteAddress defaults to client.address

    • req.remotePort defaults to client.port

    Old:

    New:

    1. const sid = req.cookie('sid', {
    2. secret: 'keyboardcat',
    3. });

    The req.body is no longer a method and no longer automatically parses JSON request bodies unless a request body was defined. The req.rawBody now corresponds to the req.rawBodyBuffer of ArangoDB 2.x and is also no longer a method.

    Old:

    New:

    1. router.post('/', function (req, res) {
    2. const data = req.body;
    3. // ...
    4. })
    5. .body(['json']);

    Or simply:

    Multipart requests

    The req.requestParts method has been removed entirely. If you need to accept multipart request bodies, you can simply define the request body using a multipart MIME type like multipart/form-data:

    1. ctrl.post('/', function (req, res) {
    2. const parts = req.requestParts();

    New: