summaryrefslogtreecommitdiffstats
path: root/ttun_server/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'ttun_server/__init__.py')
-rw-r--r--ttun_server/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ttun_server/__init__.py b/ttun_server/__init__.py
index f5d6b45..388dd9e 100644
--- a/ttun_server/__init__.py
+++ b/ttun_server/__init__.py
@@ -7,6 +7,7 @@ from starlette.routing import Host, Route, WebSocketRoute, Mount
7 7
8from authentication.backend import BearerTokenAuthBackend 8from authentication.backend import BearerTokenAuthBackend
9from authentication.endpoints import authentication, oauth 9from authentication.endpoints import authentication, oauth
10from management.endpoints import management
10from proxy import app as proxy_app 11from proxy import app as proxy_app
11from ttun_server.endpoints import health 12from ttun_server.endpoints import health
12from ttun_server.websockets import tunnel 13from ttun_server.websockets import tunnel
@@ -16,6 +17,7 @@ logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO')))
16app = FastAPI( 17app = FastAPI(
17 debug=True, 18 debug=True,
18 routes=[ 19 routes=[
20 Mount('/management/', app=management),
19 Mount('/auth/', app=authentication), 21 Mount('/auth/', app=authentication),
20 Mount('/oauth/', app=oauth), 22 Mount('/oauth/', app=oauth),
21 WebSocketRoute( 23 WebSocketRoute(
@@ -24,7 +26,7 @@ app = FastAPI(
24 ), 26 ),
25 Route('/health/', endpoint=health), 27 Route('/health/', endpoint=health),
26 Host(f'{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}', app=proxy_app) 28 Host(f'{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}', app=proxy_app)
27 ] 29 ],
28) 30)
29 31
30app.add_middleware(AuthenticationMiddleware, backend=BearerTokenAuthBackend()) 32app.add_middleware(AuthenticationMiddleware, backend=BearerTokenAuthBackend())