1 | # nuxt-start
|
2 |
|
3 | > Start Nuxt.js Application in production mode.
|
4 |
|
5 | ## Installation
|
6 |
|
7 | ```bash
|
8 | npm install --save nuxt-start
|
9 | ````
|
10 |
|
11 | Add/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
|
24 | nuxt-start <dir> -p <port number> -H <hostname> -c <config file>
|
25 | ```
|
26 |
|
27 | ## Programmatic Usage
|
28 |
|
29 | ```js
|
30 | const { Nuxt } = require('nuxt-start')
|
31 |
|
32 | // Require nuxt config
|
33 | const config = require('./nuxt.config.js')
|
34 |
|
35 | // Create a new nuxt instance (config needs dev: false)
|
36 | const nuxt = new Nuxt(config)
|
37 |
|
38 | // Start nuxt.js server
|
39 | nuxt.listen(3000) // nuxt.listen(port, host)
|
40 |
|
41 | // Or use `nuxt.render` as an express middleware
|
42 | ```
|