import express from 'express';
import path from 'path';

const app = express();
const port = process.env.PORT || 8080;

if (process.env.NODE_ENV !== 'production') {
  /* eslint-disable global-require, import/no-extraneous-dependencies */
  const webpack = require('webpack');
  const webpackDevMiddleware = require('webpack-dev-middleware');
  const webpackHotMiddleware = require('webpack-hot-middleware');
  const config = require('./webpack.config.dev.babel').default;
  const compiler = webpack(config);

  app.use(webpackHotMiddleware(compiler));
  app.use(webpackDevMiddleware(compiler, {
    noInfo: true,
    publicPath: config.output.publicPath,
  }));
}

// Serve static files
app.use(express.static(path.join(__dirname, 'public')));

console.log(`Served: http://localhost:${port}`);
app.listen(port, (err) => {
  if (err) {
    console.error(err);
  } else {
    console.info(`==> 🌎  Listening on port ${port}. Open up http://localhost:${port}/ in your browser.`);
  }
});

@@ -113,16 +113,68 @@
  8080;%0A%0A
+const STATIC_DIR = path.join(__dirname, 'public');%0A%0A
 if (proc
@@ -759,41 +759,105 @@
 tic(
-path.join(__dirname, 'public')));
+STATIC_DIR));%0Aapp.get('/*', (req,res) =%3E %7B%0A  res.sendFile(path.join(STATIC_DIR, 'index.html'))%0A%7D)
 %0A%0Aco

Set route fallback