import path from 'path';
import webpack from 'webpack';
import express from 'express';
import fs from 'fs';
import config from './webpack.config';

const app = express();
const compiler = webpack(config);

const trustedUri = 'localhost:3000';

app.use(require('webpack-dev-middleware')(compiler, {
  publicPath: config.output.publicPath
}));

app.use(require('webpack-hot-middleware')(compiler));
app.use(express.static('public'));

app.get('/api/assets/', function(req, res, next) {
  /**
   * надо понадежнее закрыть данные для скачек
   */
  if (req.headers.host === trustedUri) {
    next();
  }
}, function (req, res) {
  const svgPath = 'public/svg/';
  const svgFolders = require('./data/assets');
  const data = svgFolders.map(folder => {
    const colors = folder.colors.map(color => {
      return Object.assign({}, color, {
        files: fs.readdirSync(path.join(svgPath, folder.id, color.id))
      });
    });

    return Object.assign({}, folder, {
      colors
    });
  });
  res.setHeader('Content-Type', 'application/json');
  res.send(JSON.stringify(data));
});

app.listen(3000, function(err) {
  if (err) {
    return console.error(err);
  }

  console.log('Listening at http://' + trustedUri + '/');
});

@@ -199,16 +199,35 @@
 nfig);%0A%0A
+const port = 3000;%0A
 const tr
@@ -237,17 +237,17 @@
 edUri = 
-'
+%60
 localhos
@@ -252,13 +252,16 @@
 ost:
-3000'
+$%7Bport%7D%60
 ;%0A%0Aa
@@ -1109,20 +1109,20 @@
 .listen(
-3000
+port
 , functi

Use port as variable