UNPKG

674 BMarkdownView Raw
1# nuxt-start
2
3> Start Nuxt.js Application in production mode.
4
5## Installation
6
7```bash
8npm install --save nuxt-start
9````
10
11Add/Update your "start" script into your `package.json`:
12
13```json
14{
15 "scripts": {
16 "start": "nuxt-start"
17 }
18}
19```
20
21## Usage
22
23```bash
24nuxt-start <dir> -p <port number> -H <hostname> -c <config file>
25```
26
27## Programmatic Usage
28
29```js
30const { Nuxt } = require('nuxt-start')
31
32// Require nuxt config
33const config = require('./nuxt.config.js')
34
35// Create a new nuxt instance (config needs dev: false)
36const nuxt = new Nuxt(config)
37
38// Start nuxt.js server
39nuxt.listen(3000) // nuxt.listen(port, host)
40
41// Or use `nuxt.render` as an express middleware
42```