'use strict'

var opbeat = require('opbeat').start({
  active: process.env.NODE_ENV === 'production'
})

var express = require('express')

var app = express()

app.use(express.static('client/build'))
app.use('/api', require('./server/routes'))
app.use(opbeat.middleware.express())

var server = app.listen(process.env.PORT || 3000, function () {
  var port = server.address().port
  console.log('server is listening on port', port)
})

'use strict'

var opbeat = require('opbeat').start({
  active: process.env.NODE_ENV === 'production'
})

var path = require('path')
var express = require('express')

var app = express()

app.use(express.static('client/build'))
app.use('/api', require('./server/routes'))

app.get('*', (req, res) => {
  res.sendFile(path.resolve(__dirname, 'client/build', 'index.html'))
})

app.use(opbeat.middleware.express())

var server = app.listen(process.env.PORT || 3000, function () {
  var port = server.address().port
  console.log('server is listening on port', port)
})

Add static fallback in Express (for React routing)
Add static fallback in Express (for React routing)
