mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
feat: improve custom-server example
This commit is contained in:
parent
4b6236499c
commit
65136ac550
@ -1,8 +1,9 @@
|
||||
{
|
||||
"name": "nuxt-custom-server",
|
||||
"dependencies": {
|
||||
"chalk": "^2.2.0",
|
||||
"express": "^4.15.3",
|
||||
"nuxt": "^1.0.0-rc3"
|
||||
"nuxt": "latest"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "node server.js",
|
||||
|
@ -1,5 +1,6 @@
|
||||
const app = require('express')()
|
||||
const { Nuxt, Builder } = require('nuxt')
|
||||
const chalk = require('chalk')
|
||||
|
||||
const host = process.env.HOST || '127.0.0.1'
|
||||
const port = process.env.PORT || 3000
|
||||
@ -21,4 +22,4 @@ app.use(nuxt.render)
|
||||
|
||||
// Start express server
|
||||
app.listen(port, host)
|
||||
console.log('Server listening on ' + host + ':' + port)
|
||||
console.log('\n' + chalk.bgGreen.black(' OPEN ') + chalk.green(` http://${host}:${port}`))
|
||||
|
Loading…
Reference in New Issue
Block a user