aboutsummaryrefslogtreecommitdiffstats
path: root/backend/__init__.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2020-12-17 12:53:14 +0300
committerGravatar Hassan Abouelela <[email protected]>2020-12-17 12:55:59 +0300
commit2552ca6aa43d148b12d19dd6c511fa14864cede4 (patch)
treeb0e485760dec7c82f3165bfce0651f1f70534b07 /backend/__init__.py
parentAdds Webhook Sending Functionality (diff)
parentMerge pull request #37 from python-discord/docs/api-spec (diff)
Merge branch 'main' into discord-webhook
Signed-off-by: Hassan Abouelela <[email protected]> # Conflicts: # backend/routes/forms/submit.py
Diffstat (limited to 'backend/__init__.py')
-rw-r--r--backend/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/backend/__init__.py b/backend/__init__.py
index 770107b..5c6328b 100644
--- a/backend/__init__.py
+++ b/backend/__init__.py
@@ -5,7 +5,8 @@ from starlette.middleware.cors import CORSMiddleware
from backend.authentication import JWTAuthenticationBackend
from backend.route_manager import create_route_map
-from backend.middleware import DatabaseMiddleware
+from backend.middleware import DatabaseMiddleware, ProtectedDocsMiddleware
+from backend.validation import api
middleware = [
Middleware(
@@ -19,7 +20,9 @@ middleware = [
allow_methods=["*"]
),
Middleware(DatabaseMiddleware),
- Middleware(AuthenticationMiddleware, backend=JWTAuthenticationBackend())
+ Middleware(AuthenticationMiddleware, backend=JWTAuthenticationBackend()),
+ Middleware(ProtectedDocsMiddleware)
]
app = Starlette(routes=create_route_map(), middleware=middleware)
+api.register(app)