Skip to main content

Srve the current directory over HTTP using Python's standard library.

Project description

srve

A tiny command-line HTTP server built on Python's standard library. It can srve a directory or expose a single file.

Usage

Srve the current directory on port 8000:

uvx srve

Use a different port:

uvx srve 8080

Srve a single file:

uvx srve ./document.pdf

Srve a single file on a different port:

uvx srve ./document.pdf 8080

Bind to a specific address or srve another directory:

uvx srve --bind 127.0.0.1 --directory ./public 8080

Expose the served file or directory with a temporary Cloudflare Quick Tunnel:

uvx srve -t
uvx srve -t ./document.pdf

This prints a public trycloudflare.com URL. If cloudflared is missing, srve prompts to install it with Homebrew on macOS or winget on Windows. No Cloudflare account is required.

Run a local checkout:

uvx --from ~/serve srve

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

srve-0.3.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

srve-0.3.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file srve-0.3.0.tar.gz.

File metadata

  • Download URL: srve-0.3.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for srve-0.3.0.tar.gz
Algorithm Hash digest
SHA256 11ab21facd5d8573951a11768bed4f0b01445c42851d0b8440e1c0c828f407db
MD5 486339ac432b87fe3252b5ffcd71eae1
BLAKE2b-256 6c2f591119a7c0e56d545145a7a5946f5fcac1153b6625ef51fabf54b9bd167e

See more details on using hashes here.

File details

Details for the file srve-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: srve-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for srve-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41be290f24c139d755a7df2a739ef0c9073d9fa8268f50ee6ac85ff0cde24537
MD5 a4ad4fe3876a02952485fa962be26966
BLAKE2b-256 3138da679bdb13d412e8172c5beb8a600f475a3c08d5c4b2d74592e1905be8d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page