2021-06-14 12:31:30 +00:00
|
|
|
# Node.js server
|
|
|
|
|
2021-07-15 09:38:06 +00:00
|
|
|
- Default preset if none is specified or auto-detected
|
|
|
|
- Loads only the chunks required to render the request for optimal cold start timing
|
|
|
|
- Useful for debugging
|
2021-06-14 12:31:30 +00:00
|
|
|
|
|
|
|
### Entrypoint
|
|
|
|
|
|
|
|
With `{ preset: 'server' }` the result will be an entrypoint that launches a ready-to-run Node server.
|
|
|
|
|
|
|
|
#### Example
|
|
|
|
|
|
|
|
```bash
|
2021-07-15 09:38:06 +00:00
|
|
|
node .output/server/index.mjs
|
2021-06-14 12:31:30 +00:00
|
|
|
# > Load chunks/nitro/server (10.405923ms)
|
|
|
|
# > Cold Start (26.289817ms)
|
|
|
|
# Listening on http://localhost:3000
|
|
|
|
|
|
|
|
curl http://localhost:3000
|
|
|
|
```
|