From 78e40ba13ea05909752ba460994305fad285308a Mon Sep 17 00:00:00 2001 From: Johan Zietsman Date: Tue, 30 Oct 2018 15:03:40 +0200 Subject: [PATCH] Fixes to static files documentation. (#162) * I fixed a grammar error. The example code did not work, since there are no Path and PathPrefix classes in starlette.routing. I replaced PathPrefix with Mount to get it to work. * I fixed a spelling error. --- docs/debug.md | 2 +- docs/staticfiles.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/debug.md b/docs/debug.md index c6c9f502..52e194cf 100644 --- a/docs/debug.md +++ b/docs/debug.md @@ -16,6 +16,6 @@ class App: app = DebugMiddleware(App) ``` -For a mode complete handling of exception cases you may wish to use Starlette's +For a more complete handling of exception cases you may wish to use Starlette's [`ExceptionMiddleware`](../exceptions/) class instead, which also includes optional debug handling. diff --git a/docs/staticfiles.md b/docs/staticfiles.md index f1b9d0a5..448cc3b9 100644 --- a/docs/staticfiles.md +++ b/docs/staticfiles.md @@ -1,5 +1,5 @@ -Starlette also includes an `StaticFiles` class for serving a specific directory: +Starlette also includes a `StaticFiles` class for serving a specific directory: * `StaticFiles(directory)` - Serve any files in the given `directory`. @@ -7,12 +7,12 @@ You can combine this ASGI application with Starlette's routing to provide comprehensive static file serving. ```python -from starlette.routing import Router, Path, PathPrefix +from starlette.routing import Router, Mount from starlette.staticfiles import StaticFiles app = Router(routes=[ - PathPrefix('/static', app=StaticFiles(directory='static')), + Mount('/static', app=StaticFiles(directory='static')), ]) ```