title | description |
---|---|
Netlify CLI dev command |
Run netlify dev locally |
Local dev server The dev command will run a local dev server with Netlify's proxy and redirect rules
Usage
netlify dev
Flags
command
(string) - command to runport
(string) - port of netlify devtargetPort
(string) - port of target app serverdir
(string) - dir with static filesfunctions
(string) - specify a functions folder to serveoffline
(boolean) - disables any features that require network accesslive
(boolean) - start a public live sessiondebug
(boolean) - Print debugging informationhttpProxy
(string) - Proxy server address to route requests through.httpProxyCertificateFilename
(string) - Certificate file to use when connecting using a proxy server
Subcommand | description |
---|---|
dev:exec |
Exec command |
dev:trace |
Trace command |
Examples
$ netlify dev
$ netlify dev -c "yarn start"
$ netlify dev -c hugo
Exec command Runs a command within the netlify dev environment, e.g. with env variables from any installed addons
Usage
netlify dev:exec
Flags
debug
(boolean) - Print debugging informationhttpProxy
(string) - Proxy server address to route requests through.httpProxyCertificateFilename
(string) - Certificate file to use when connecting using a proxy server
Examples
$ netlify dev:exec npm run bootstrap
Trace command Simulates Netlify's Edge routing logic to match specific requests. This command is designed to mimic cURL's command line, so the flags are more familiar.
Usage
netlify dev:trace
Arguments
- url - Sets the request URL
Flags
request
(string) - Specifies a custom request method [default: GET]cookie
(string) - Request cookie, this flag can be used multiple times. Example: "nf_jwt=token"header
(string) - Request header, this flag can be used multiple times. Example: "Host: netlify.test"watch
(string) - Path to the publish directorydebug
(boolean) - Print debugging information
Examples
$ netlify dev:trace http://localhost/routing-path
$ netlify dev:trace -w dist-directory http://localhost/routing-path
$ netlify dev:trace -X POST http://localhost/routing-path
$ netlify dev:trace -H "Accept-Language es" http://localhost/routing-path
$ netlify dev:trace --cookie nf_jwt=token http://localhost/routing-path