Plugin: fx-middleware
Description
Common express middlewares. Implement the middleware service
Config
specify the argument --middleware [config file path] to config the middleware If the config file is not specified
Interface
morgan
web app server log middleware
config it with 'morgan' field
default:
morgan: path: globalhome + '/logs' format: 'short' // combined, common, dev, short, tiny, or user defined filePrefix: 'access_';
cookieParser
express cookie parser middleware
var cookieParser = ;return
urlEncodedParser
var bodyParser = ;return
jsonParser
var bodyParser = ;return
session
support three types of session:
- memory
- mongodb
- redis
Config the session types with 'sessionStore' config key default: 'memory'
Config the session secret with 'sessionSecret'
Mongodb configuration is defined in mongodb service
Redis configuration is defined in redis service
compression
var compression = ;return