import config from './config';
import express from 'express';
import {Server} from 'http';

const app = express();
const server = Server(app);

// Load API
app.use('/api/v1', require('./api'));

// Load react-js frontend.
app.use(require('./frontend'));

// Add error handler. Four arguments need to be defined in order for the
// middleware to act as an error handler.
app.use((err, req, res, next) => {
  const msg = err.stack || err;
  console.log('Yay', msg);
  res.status(500).send('500: ' + msg);
});

server.listen(config.port, () => {
  console.log('Server started at port %s', config.port);
});

@@ -1,12 +1,37 @@
+import api from './api';%0A
 import confi
@@ -80,16 +80,51 @@
 press';%0A
+import frontend from './frontend';%0A
 import %7B
@@ -208,16 +208,17 @@
 Load API
+.
 %0Aapp.use
@@ -233,24 +233,11 @@
 1', 
-require('./
 api
-')
 );%0A%0A
@@ -275,27 +275,16 @@
 use(
-require('./
 frontend
 '));
@@ -283,10 +283,8 @@
 tend
-')
 );%0A%0A

Replace require with import.