text: import express from 'express'
  import { Nuxt, Builder } from 'nuxt'
  
  import api from './api'
  
  const bodyParser = require('body-parser')
  const app = express()
  const host = process.env.HOST || '0.0.0.0'
  const port = process.env.PORT || 3000
  process.env.TZ = 'Europe/London'
  
  app.set('port', port)
  
  // parse application/x-www-form-urlencoded
  app.use(bodyParser.urlencoded({ extended: false }))
  
  // parse application/json
  app.use(bodyParser.json())
  
  // Import API Routes
  app.use('/api', api)
  
  // Import and Set Nuxt.js options
  let config = require('../nuxt.config.js')
  config.dev = !(process.env.NODE_ENV === 'production')
  
  // Init Nuxt.js
  const nuxt = new Nuxt(config)
  
  // Build only in dev mode
  if (config.dev) {
    const builder = new Builder(nuxt)
    builder.build()
  }
  
  // Give nuxt middleware to express
  app.use(nuxt.render)
  
  // Listen the server
  app.listen(port, host)
  console.log('Server listening on ' + host + ':' + port) // eslint-disable-line no-console
  console.log('Enviroment variables: ' + process.env.BASE_URL + ' ' + process.env.AUTH_USER + ' ' + process.env.AUTH_PASS)
  