Skip to content

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

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 2, 2025

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f5bd5fe
Status: ✅  Deploy successful!
Preview URL: https://ef694d02.flet-docs.pages.dev
Branch Preview URL: https://feodor-v1-serve-cli.flet-docs.pages.dev

View logs

Replaces old CLI command docs (build, create, doctor, pack, publish, run) with new files prefixed by 'flet-' and updates their content for improved clarity and completeness. Updates all internal references and navigation to use the new filenames and command names. Also updates build.py to recommend 'flet serve' for serving web apps instead of Python's http.server.
@FeodorFitsner FeodorFitsner merged commit 0e74019 into main Aug 6, 2025
3 checks passed
@FeodorFitsner FeodorFitsner deleted the feodor/v1-serve-cli branch August 6, 2025 19:44
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.

3 participants