Skip to content

v1: Flet CLI: Add flet serve command to run HTTP server with WASM support #5441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FeodorFitsner
Copy link
Contributor

@FeodorFitsner FeodorFitsner commented Jul 11, 2025

usage: flet serve [-h] [-v] [--port PORT]
                  [--web-root WEB_ROOT]

Serve static files from a directory with optional WASM
headers.

options:
  -h, --help           show this help message and exit
  -v, --verbose        -v for detailed output and -vv for more
                       detailed
  --port PORT          Port to serve on (default: 8000)
  --web-root WEB_ROOT  Directory to serve (default:
                       ./build/web)

Summary by Sourcery

Add a "serve" command to the Flet CLI for hosting static files over HTTP with WebAssembly-friendly headers and configurable port and web root options.

New Features:

  • Add "flet serve" command to serve static files with COOP, COEP, and CORS headers
  • Allow users to specify server port and web root directory
  • Handle directory validation, keyboard interrupts, and OS errors with user-friendly messages

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

Copy link
Contributor

@ndonkoHenri ndonkoHenri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants