Application
Expressify’s app factory. This module exports a function you can use to create and configure an express app. With some often used settings and middlewares.
Options
body: Object to configure thebody-parsermiddleware. Subkeys map to methods on body-parser, passingtruewill call the method without options while setting an object will pass that object to body parser. Defaults to{ json: true }to enable JSON formatted body parsing.compression: Enablecompressionmiddleware. Usetrueto enable or an object to customize options. Defaults totrue.cors: Enable Expressify’s CORS middleware. Usetrueto enable or an object to customize its options. Defaults totrue.express: Use this to pass in a customexpressmodule. Defaults to the express module defined in Expressify’s dependencies.trustProxy: Set express’trust proxysetting. Defaults totrue.
Example
const expressify = require('@ambassify/expressify');
// Default options
const app = expressify.createApp();
// URL encoded body instead of JSON
const app = expressify.createApp({
body: {
urlencoded: true
}
});