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__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ttun_server/__init__.py b/ttun_server/__init__.py
index d54227a..4af6ca0 100644
--- a/ttun_server/__init__.py
+++ b/ttun_server/__init__.py
@@ -2,10 +2,11 @@ import logging
2import os 2import os
3 3
4from fastapi import FastAPI 4from fastapi import FastAPI
5from starlette.routing import Host, Route, WebSocketRoute 5from starlette.routing import Host, Route, WebSocketRoute, Mount
6 6
7from authentication.endpoints import authentication, oauth
7from proxy import app as proxy_app 8from proxy import app as proxy_app
8from ttun_server.endpoints import health, base_endpoints 9from ttun_server.endpoints import health
9from ttun_server.websockets import tunnel 10from ttun_server.websockets import tunnel
10 11
11logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO'))) 12logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO')))
@@ -13,6 +14,8 @@ logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO')))
13app = FastAPI( 14app = FastAPI(
14 debug=True, 15 debug=True,
15 routes=[ 16 routes=[
17 Mount('/auth/', app=authentication),
18 Mount('/oauth/', app=oauth),
16 WebSocketRoute('/tunnel/', endpoint=tunnel), 19 WebSocketRoute('/tunnel/', endpoint=tunnel),
17 Route('/health/', endpoint=health), 20 Route('/health/', endpoint=health),
18 Host(f'{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}', app=proxy_app) 21 Host(f'{{subdomain}}.{os.environ['TUNNEL_DOMAIN']}', app=proxy_app)