API Reference
  • Introduction
  • 💻CLI Commands
    • Create commands
      • create
      • create-package
    • Run commands
      • dev
      • serve
    • Build commands
      • build
    • Extra commands
  • 🍱Packages
    • 💙Core package
      • frontity
    • ⚡Features packages
      • @frontity/wp-source
      • @frontity/tiny-router
      • @frontity/html2react
      • @frontity/head-tags
      • @frontity/yoast
      • @frontity/google-ad-manager
      • @frontity/smart-adserver
      • analytics packages
        • @frontity/google-analytics
        • @frontity/google-tag-manager-analytics
        • @frontity/comscore-analytics
      • @frontity/wp-comments
    • 📚Collections packages
      • @frontity/components
      • @frontity/hooks
        • Infinite Scroll Hooks
        • Intersection Observer Hooks
    • 🎨Themes Packages
      • @frontity/twentytwenty-theme
      • @frontity/mars-theme
  • 🔌WordPress Plugins
    • REST API - Head Tags
    • Frontity Embedded Mode
Powered by GitBook
On this page
  • Arguments
  • [options]
  • Environment Variables
  • FRONTITY_SERVE_PORT
  • FRONTITY_SERVE_HTTPS

Was this helpful?

  1. CLI Commands
  2. Run commands

serve

PreviousdevNextBuild commands

Last updated 4 years ago

Was this helpful?

Starts a Frontity server in production mode.

npx frontity serve [options]

This frontity serve command will use the files generated by

Arguments

[options]

Option

Description

--port <port>

--https

--help

Output usage information

Examples

  • Starts a server (using the code in the build folder generated by the npx frontity build command) using https and port 3002

npx frontity serve --https --port 3002

Environment Variables

FRONTITY_SERVE_PORT

Runs the server on a custom port. Default is 3000.

Example:

FRONTITY_SERVE_PORT=3002

FRONTITY_SERVE_HTTPS

Runs the server using https.

Example:

FRONTITY_SERVE_HTTPS=true

Runs the server on a custom port. Default is 3000. Related environment variable:

Runs the server using https. Related environment variable:

If detected, and no --port <port> option is defined for Frontity command, this environment variable value will be applied.

💻
frontity build
serve
FRONTITY_SERVE_PORT
FRONTITY_SERVE_HTTPS