INNER CODE UNIT · Python

add_static_route

falconry/falcon · falcon/app.py:727

    def add_static_route(
        self,
        prefix: str,
        directory: str | pathlib.Path,
        downloadable: bool = False,
        fallback_filename: str | None = None,
    ) -> None:
        """Add a route to a directory of static files.

        Static routes provide a way to serve files directly. This
        feature provides an alternative to serving files at the web server
        level when you don't have that option, when authorization is
        required, or for testing purposes.

        Warning:
            Serving files directly from the web server,
            rather than through the Python app, will always be more efficient,
            and therefore should be preferred in production deployments.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…