serve
Starts a Frontity server in production mode.
npx frontity serve [options]This frontity serve command will use the files generated by frontity build
Arguments
[options]
[options]Option
Description
--port <port>
Runs the server on a custom port. Default is 3000. Related environment variable: FRONTITY_SERVE_PORT
--https
Runs the server using https. Related environment variable: FRONTITY_SERVE_HTTPS
--help
Output usage information
Examples
Starts a server (using the code in the
buildfolder generated by thenpx frontity buildcommand) using https and port 3002
npx frontity serve --https --port 3002Environment Variables
FRONTITY_SERVE_PORT
FRONTITY_SERVE_PORTRuns the server on a custom port. Default is 3000.
If detected, and no --port <port> option is defined for serve Frontity command, this environment variable value will be applied.
Example:
FRONTITY_SERVE_PORT=3002FRONTITY_SERVE_HTTPS
FRONTITY_SERVE_HTTPSRuns the server using https.
Example:
FRONTITY_SERVE_HTTPS=trueLast updated
Was this helpful?