import express from 'express'
import session from 'express-session'
import path from 'path'
import favicon from 'serve-favicon'
import logger from 'morgan'
import cookieParser from 'cookie-parser'
import bodyParser from 'body-parser'
import mongoose from 'mongoose'
import passport from 'passport'
import flash from 'connect-flash'

/* Express setup */
let app = express()

// view engine setup
app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'ejs')
app.set('api version', '1.0')

app.use(favicon(path.join(__dirname, 'public/favicon.ico')))
app.use(logger('short'))
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({
  extended: false
}))
app.use(cookieParser())
app.use(session({
  secret: 'pusheeeen',
  resave: false,
  saveUninitialized: false
}))
app.use(express.static(path.join(__dirname, 'public')))
app.use(flash())
app.use(passport.initialize())
app.use(passport.session())

// Initialize mongoose singleton
if (!process.env.MONGO_URL) {
  throw new Error('Missing MONGO_URL environment variable')
}
mongoose.connect(process.env.MONGO_URL)

/* Front end routes */
import index from './routes/index'
import docs from './routes/docs'
app.use('/', index)
app.use('/docs', docs)

/* User routes */
import user from 'user'
app.use('/user', user)

/* API routes */
import uoftCourseApi from 'uoft-course-api'
import uoftBuildingApi from 'uoft-building-api'
import uoftFoodApi from 'uoft-food-api'
app.use('/api/courses', uoftCourseApi)
app.use('/api/buildings', uoftBuildingApi)
app.use('/api/food', uoftFoodApi)


/* Error handlers */

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

// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
  app.use(function(err, req, res, next) {
    res.status(err.status || 500)
    res.json({
      "error": {
        code: err.status,
        message: err.message
      }
    })
  })
}

// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
  res.status(err.status || 500)
  res.render('error', {
    message: err.message,
    error: {}
  })
})


module.exports = app

@@ -1616,24 +1616,16 @@
 app.use(
-function
 (req, re
@@ -1628,24 +1628,27 @@
 , res, next)
+ =%3E
  %7B%0A  let err
@@ -1808,32 +1808,24 @@
 %7B%0A  app.use(
-function
 (err, req, r
@@ -1829,24 +1829,27 @@
 , res, next)
+ =%3E
  %7B%0A    res.s
@@ -1898,15 +1898,13 @@
     
-%22
 error
-%22
 : %7B%0A
@@ -2054,16 +2054,8 @@
 use(
-function
 (err
@@ -2071,16 +2071,19 @@
 s, next)
+ =%3E
  %7B%0A  res
@@ -2186,25 +2186,22 @@
 %7D)%0A%0A
-%0Amodule.exports =
+export default
  app

Use arrows & export default