old_contents: const bodyParser = require('body-parser')
  const express = require('express')
  const jwt = require('express-jwt')
  const path = require('path')
  const html = require('@conveyal/woonerf/html')
  
  const routes = require('./routes')
  
  const SECRET = process.env.AUTH0_SECRET
  
  const app = express()
  
  // middleware
  if (SECRET) {
    app.use(jwt({secret: SECRET}))
  }
  app.use(bodyParser.json())
  
  // static assets
  app.use('/assets', express.static(path.resolve(__dirname, '../assets')))
  
  // api
  routes(app)
  
  // webapp
  app.get('*', (req, res) =>
    res.status(200).type('html').send(html({title: 'Commute'})))
  
  module.exports = app
  
new_contents: const bodyParser = require('body-parser')
  const express = require('express')
  const jwt = require('express-jwt')
  const path = require('path')
  const html = require('@conveyal/woonerf/html')
  
  const routes = require('./routes')
  
  const SECRET = process.env.AUTH0_SECRET
  
  const app = express()
  
  // middleware
  if (SECRET) {
    app.use(jwt({secret: SECRET}))
  }
  app.use(bodyParser.json())
  
  // static assets
  app.use('/assets', express.static(path.resolve(__dirname, '../assets')))
  
  // api
  routes(app)
  
  let htmlString
  const title = 'Commute'
  if (process.env.MONGODB_URI) {
    // In heroku environment, get js and css from s3
    const host = process.env.STATIC_HOST
    htmlString = `<!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
        <link href="${host}assets/index.css" rel="stylesheet">
  
        <title>${title}</title>
      </head>
      <body>
        <div id="root"></div>
        <script src="${host}assets/index.js"></script>
      </body>
    </html>
    `
  } else {
    htmlString = html({title})
  }
  
  // webapp
  app.get('*', (req, res) => res.status(200).type('html').send(htmlString))
  
  module.exports = app
  
subject: use s3 to serve static files