var express = require('express');
var path = require('path');
var logger = require('morgan');
var bodyParser = require('body-parser');

var apiRouter = require('./routes/api');

var app = express();

// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

app.use('/api', apiRouter);

// catch 404 and forward to error handler
app.use(function(req, res, next) {
  var err = new Error('Not Found');
  err.status = 404;
  next(err);
});

// error handler
app.use(function(err, req, res, next) {
  // set locals, only providing error in development
  res.locals.message = err.message;
  res.locals.error = req.app.get('env') === 'development' ? err : {};

  // render the error page
  res.status(err.status || 500);
  res.json(err);
});

module.exports = app;

@@ -1,11 +1,13 @@
-var
+const
  express
@@ -29,19 +29,21 @@
 ress');%0A
-var
+const
  path = 
@@ -59,19 +59,21 @@
 path');%0A
-var
+const
  logger 
@@ -93,19 +93,21 @@
 rgan');%0A
-var
+const
  bodyPar
@@ -136,20 +136,52 @@
 rser');%0A
-%0Avar
+const cors = require('cors');%0A%0Aconst
  apiRout
@@ -211,19 +211,21 @@
 api');%0A%0A
-var
+const
  app = e
@@ -239,126 +239,8 @@
 );%0A%0A
-// uncomment after placing your favicon in /public%0A//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));%0A
 app.
@@ -337,24 +337,41 @@
 false %7D));%0A%0A
+app.use(cors());%0A
 app.use('/ap

Enable CORS