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.1

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.1
File Size Uploaded Provenance Actions
starlette_rootpath_middleware-1.0.1.tar.gz 7.4 kB With provenance Details for starlette_rootpath_middleware-1.0.1.tar.gz

Built distribution (wheel)

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

Total release size: 12.4 kB

Release files / starlette_rootpath_middleware-1.0.1.tar.gz

Download URL starlette_rootpath_middleware-1.0.1.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9635e4228cc254ba3c1fef2eca9eeab612883d10d07d6ecebaa0d2f0752faa6c
BLAKE2b-256 checksum
How to use checksums
7f5e6d7cf7bb638ebf761e412e67ee30b13829b88927758a1de326502499b72b
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.1-py3-none-any.whl

Download URL starlette_rootpath_middleware-1.0.1-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afe0eca37580d286dcb15111bdd8b132984134df0d2049eed06d7f247cb31036
BLAKE2b-256 checksum
How to use checksums
795365363cdfee6f0c6b2f3e57d5f3daacd4f2f2d8701065b31d0dcd7571b602
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.1

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.1.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.1 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