Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function renderer({
clientStats,
server,
sessionStore,
promises,
}: any) {
const app = express.Router();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded(config.bodyParser.urlencoded));
app.use(cookieParser(config.cookieParser as any));
app.use(session({ store: sessionStore, ...config.session }));
app.use(csurf(config.csurf));
app.use(serverTiming());
app.use(favicon(config.favicon));
app.use(useragent.express());
if (!__DEVELOPMENT__) {
const assetsHandler = new AssetsHandler(clientStats.assets);
app.use(
clientStats.publicPath,
assetsHandler.handleUrl.bind(assetsHandler),
);
}
config.assets.forEach(asset => {
app.use(asset.mount, express.static(asset.path));
});
app.use(config.clientConfig.fetchr.xhrPath, apiGateway(config, app));