import * as bodyParser from 'body-parser' ; import * as cors from 'cors' ; import * as express from 'express' ; import { config } from './config' ; export function mountMiddleware ( app ) { app . use ( '/' , express . static ( config . publicPath ) ) ; app . use ( '/docs' , express . static ( config . userDocsPath ) ) ; app . use ( bodyParser . json ( { limit : '10mb' } ) ) ; if ( config . nodeEnvironment === 'development' ) { app . use ( cors ( ) ) ; } }