🚀Announcing Flightcontrol - Easily Deploy Blitz.js and Next.js to AWS 🚀
Back to Documentation Menu

blitz dev

Alias: blitz d

Starts the Blitz development server.

This is a super thin wrapper over Next CLI to improve environment variable loading.

blitz dev -e staging

It does the following:

  1. Loads correct .env.X and .env.X.local files based on the -e X flag that you specify. Ex: -e staging loads .env.staging.
  2. Sets process.env.APP_ENV to the env name. Ex: -e staging => APP_ENV=staging.
  3. Passes all other arguments directly to the next build command

Options

OptionShorthandDescriptionDefault
--hostname-HSet the hostname to use for the server."localhost"
--port-pSet the port you'd like the server to listen on.3000
--no-incremental-buildDisable incremental build and start from a fresh cachefalse
--inspectEnable the Node.js inspectorfalse
--env-eSet app environment name. Read more.None

Examples

blitz dev
blitz dev -p 4000

Idea for improving this page? Edit it on GitHub.