reserve

custom handler

🔝 REserve documentation

Enables custom handlers.

{
  custom: async (request, response) => response.setHeader('X-Server', 'REserve')
}

Example of embedded mapping with the custom handler

{
  custom: './xserver.js'
}

Example of mapping with the custom handler

module.exports = async (request, response) => response.('X-Server', 'REserve')

Corresponding xserver.js file

Features

The custom property can be either an external module or a function that accepts at least two parameters : request and response.

[!IMPORTANT] Only if the function’s length is 0or greater than 2

[!CAUTION] It overwrites any existing member with the same name