App features
App features are settings that slightly modify app behavior.
Toggle app features
You can enable, disable and toggle different app features with LunaticServer
methods app.enable()
, app.disable()
and app.toggle()
respectively.
import { LunaticServer } from '@shelepuginivan/lunatic'
const app = new LunaticServer()
app.disable('x-powered-by') // disables X-Powered-By header which is set by default
List of app features:
If you are using TypeScript, you can import type
ApplicationFeature
:import { ApplicationFeature } from '@shelepuginivan/lunatic'
Currently, these features are available:
500-on-error
- send500 Internal Server Error
status if error occurred during request handling. Enabled by defaultauto-head-handler
- automatically respond to HEAD requests with same headers, but without body and status code204 No Content
. Enabled by defaultx-powered-by
- set response headerX-Powered-By: Lunatic
. Enabled by default