A production-grade nuxt server.
npm install nuxt-cluster --save
import server from 'nuxt-cluster'
server.start({
dev: false,
workers: 2,
workerMaxRequests: 1000, // gracefully restart worker after 1000 requests
workerMaxLifetime: 3600, // gracefully restart worker after 1 hour
rootDir: '/app/',
address: '0.0.0.0',
port: 3000,
})
- Default:
false
Set to true to run nuxt in development mode
- Default:
# cpu's
How many workers should be started. Defaults to the number of cpus in the system
- Default:
If set to a value greater then 0, each worker will be gracefully restarted after it has handled this many requests. As the worker is restarted gracefully, it will be handle all open connections before closing.
- Default:
If set to a value greater then 0, each worker will be gracefully restarted after it has been alive this many seconds.
- Default:
Set this to the rootDir of your nuxt project. See the Nuxt.js docs for more info.
- Default:
0.0.0.0
The address the server will listen to
- Default:
3000
The port the server will listen to
MIT