import path from 'path';
import express from 'express';
import makeExtractor from '../makeExtractor';
import serverExports from '__sku_alias__serverEntry';
import webpackStats from '__sku_alias__webpackStats';

const publicPath = __SKU_PUBLIC_PATH__; // eslint-disable-line no-undef

const serverOptions = serverExports({ publicPath });

const { renderCallback, middleware, onStart } = serverOptions;

const app = express();

const env = process.env.NODE_ENV || 'development';

if (env === 'development') {
  app.use(express.static(path.join(__dirname, './')));
}

if (middleware) {
  app.use(middleware);
}
app.get('*', (...args) =>
  renderCallback(makeExtractor(webpackStats, publicPath), ...args),
);

export { app, onStart };

@@ -558,16 +558,255 @@
 )));%0A%7D%0A%0A
+if (env !== 'development') %7B%0A  // Disable x-powered-by header according to Express Best Practice%0A  // https://expressjs.com/en/advanced/best-practice-security.html#at-a-minimum-disable-x-powered-by-header%0A  app.disable('x-powered-by');%0A%7D%0A%0A
 if (midd

Disable x-powered-by in production (#358)