pw endpoints serve
Serve a static site directory as an endpoint
Synopsis
Serve a built single-page-app directory (e.g. a Vite "dist") through an endpoint. The CLI runs a static file server with SPA history fallback on a local port and forwards it — no separate web server needed.
Use a subdomain (the default) so the app is served at the domain root and a standard base:'/' build works unchanged.
pw endpoints serve DIR [flags]Examples
pw endpoints serve ./dist
# Named and opened in the browser
pw endpoints serve --name my_app --open ./distOptions
--description string Session description (defaults to "Endpoint on <hostname>")
-h, --help help for serve
--keep Keep the endpoint session on exit instead of deleting it
-n, --name string Name for the endpoint session (defaults to a server-generated name)
--no-subdomain Skip subdomain assignment and use the path-based session URL
--open Open the endpoint URL in the browser
-o, --output string Output format (interactive, text); interactive shows a live dashboard and downgrades to text when stdout is not a terminal (default "interactive")
--public Make the endpoint publicly accessible: anyone with the link can reach it without logging in. Requires your organization to allow public sessions.
--rewrite-host string[="localhost"] Rewrite the Host header sent to your local app to this value (defaults to "localhost" when the flag is given without one). Use for an app that rejects the public endpoint host, such as a DNS-rebinding guard or an allowed-hosts check.
--slug string Session base-path slug (default "/")
--strip-path Strip the session URL prefix before forwarding to your app (use only if your app serves at the root path and can't be configured with a base path; by default the full path is forwarded so set your app's base path to the endpoint URL)
-s, --subdomain string Serve at this subdomain: a label (my-app), which lands on the platform's default sessions domain, or the full host under any registered sessions domain (my-app.<sessions domain>); a random subdomain is used by default when the platform supports themOptions inherited from parent commands
--context string The context to use. Overrides PW_CONTEXT environment variable and current context from config.
--platform-host string The Parallel Works ACTIVATE platform host to use. Will override any other platform host settings.
-v, --verbose Enable verbose loggingSEE ALSO
- pw endpoints - Create and serve self-registering endpoint sessions