Configure Express.
npm install express-mechanic -S
import express from 'express';
import callInitializer from 'call-initializer';
import {
pug,
render404,
urlencodedParser,
} from 'express-mechanic';
callInitializer(express(),
urlencodedParser(),
pug(__dirname + '../views'),
render404()
)((err, app) => {
// ...
});
Requirement: aws-sdk
Adds properties to use aws-sdk.
options.region
- A string to specify a region.
- If this option is not speficied, the environment variable
AWS_REGION
is used instead. If it is also undefiend, a region is determined by using MetadataService.
AWS_REGION
Makes an app to use bodyParser.json.
options.path
- A path to use the body-parser middleware.
options
is passed to bodyParser.json too.
Set app.locals
and app.settings
.
locals
- An object of values that are set to
app.locals
.
- An object of values that are set to
locals.settings
- An object of values that are set to
app.settings
.
- An object of values that are set to
TRUST_PROXY
Makes an app to use pug.
Makes an app to use serve-static.
Makes an app to use bodyParser.urlencoded.
options.path
- A path to use the body-parser middleware.
options
is passed to bodyParser.urlencoded too.
MIT