2017-07-30 16:24:53 +00:00
|
|
|
# nuxt-start
|
2017-06-21 16:32:57 +00:00
|
|
|
|
2020-11-30 22:44:04 +00:00
|
|
|
> Start Nuxt Application in production mode.
|
2017-07-30 16:24:53 +00:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm install --save nuxt-start
|
|
|
|
````
|
|
|
|
|
|
|
|
Add/Update your "start" script into your `package.json`:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"scripts": {
|
|
|
|
"start": "nuxt-start"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```bash
|
|
|
|
nuxt-start <dir> -p <port number> -H <hostname> -c <config file>
|
|
|
|
```
|
|
|
|
|
|
|
|
## Programmatic Usage
|
|
|
|
|
|
|
|
```js
|
|
|
|
const { Nuxt } = require('nuxt-start')
|
|
|
|
|
|
|
|
// Require nuxt config
|
|
|
|
const config = require('./nuxt.config.js')
|
|
|
|
|
2018-11-08 09:15:56 +00:00
|
|
|
// Create a new nuxt instance (config needs dev: false)
|
2017-07-30 16:24:53 +00:00
|
|
|
const nuxt = new Nuxt(config)
|
|
|
|
|
2020-11-30 22:44:04 +00:00
|
|
|
// Start nuxt server
|
2017-07-30 16:24:53 +00:00
|
|
|
nuxt.listen(3000) // nuxt.listen(port, host)
|
|
|
|
|
|
|
|
// Or use `nuxt.render` as an express middleware
|
|
|
|
```
|