Skip to content

Commit bda742d

Browse files
committed
README: Fix instructions for local preview (2)
Fixup for the last commit (014130a). I forgot to stage and commit the changes to the README.md file.
1 parent 014130a commit bda742d

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,31 @@ I recommend you still use `next dev` to build and preview your application local
7575

7676
But if you want to emulate the Netlify deployment on your computer, you can also run `next-on-netlify` locally and then use `netlify-cli` to preview the result.
7777

78-
To do that, first install `serve` and `netlify-cli`:
78+
To do that, first install `http-server` and `netlify-cli`:
7979
```
80-
npm install --save-dev serve
80+
npm install --save-dev http-server
8181
npm install -g netlify-cli
8282
```
8383

8484
Then add the following `[dev]` block to your `netlify.toml`:
8585

8686
```toml
87+
# netlify.toml
88+
89+
# [build]
90+
# ...
91+
8792
[dev]
88-
command = "serve public -p 3000"
93+
# We use HTTP server without directory listings (-d false),
94+
# without caching (-c-1), and without log output (--silent).
95+
# More info: https://www.npmjs.com/package/http-server
96+
command = "http-server --port 3999 -d false -c-1 --silent"
8997
functions = "functions"
9098
publish = "public"
99+
# We manually set the framework to static, otherwise Netlify automatically
100+
# detects NextJS and redirects do not work.
101+
# Read more: https://github.com/netlify/cli/blob/master/docs/netlify-dev.md#project-detection
102+
framework = "#static"
91103
```
92104

93105
And add the following lines to your `.gitignore`:

0 commit comments

Comments
 (0)