Skip to main content

starlette-rootpath-middleware

FastAPI 0.146.0 deprecated FastAPI()'s root_path parameter in favor of a --root-path command-line flag to fastapi run. If you specifically need to set the root path at runtime, you can use this middleware.

Though built for FastAPI, there is nothing FastAPI-specific about this middleware and it should work with all Starlette applications.

Installation

pip install starlette-rootpath-middleware

Usage

from fastapi import FastAPI
from starlette_rootpath_middleware import RootPathMiddleware

app = FastAPI()
app.add_middleware(RootPathMiddleware, root_path="/some/path/")

Metadata

Release files for starlette-rootpath-middleware 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for starlette-rootpath-middleware 1.0.0
File Size Uploaded Provenance Actions
starlette_rootpath_middleware-1.0.0.tar.gz 7.4 kB With provenance Details for starlette_rootpath_middleware-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for starlette-rootpath-middleware 1.0.0
File Interpreter ABI Platform Actions
starlette_rootpath_middleware-1.0.0-py3-none-any.whl Python 3 none any Details for starlette_rootpath_middleware-1.0.0-py3-none-any.whl

Total release size: 12.4 kB

Release files / starlette_rootpath_middleware-1.0.0.tar.gz

Download URL starlette_rootpath_middleware-1.0.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
110c6f897ad8e87f55b09fd9be69b6806ec48eb7de4a474ce291b2497d70a018
BLAKE2b-256 checksum
How to use checksums
8704687c749d6085890ce590f8874223be972afbd53800ea606e98ab985ef15c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / starlette_rootpath_middleware-1.0.0-py3-none-any.whl

Download URL starlette_rootpath_middleware-1.0.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e21e77819e3a5e46bcf40cec94de228c5a01396c2cf35a7d801187298fbb016a
BLAKE2b-256 checksum
How to use checksums
c24ce52881a6d1725f0eb04d1e925a329c1b1efc85ad2f3ee1b960eb18117198
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for starlette-rootpath-middleware 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for starlette_rootpath_middleware-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page