Advertisement
Guest User

Untitled

a guest
Jul 13th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const next = require('next')
  2. const routes = require('./routes')
  3. const app = next({ dev: process.env.NODE_ENV !== 'production' })
  4. const handler = routes.getRequestHandler(app)
  5. const port = process.env.PORT || 3000
  6.  
  7. // Without express
  8. const { createServer } = require('http')
  9. app.prepare().then(() => {
  10.     createServer(handler).listen(port)
  11. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement