diff options
Diffstat (limited to 'ttun_server/__init__.py')
| -rw-r--r-- | ttun_server/__init__.py | 7 |
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 | |||
| 2 | import os | 2 | import os |
| 3 | 3 | ||
| 4 | from fastapi import FastAPI | 4 | from fastapi import FastAPI |
| 5 | from starlette.routing import Host, Route, WebSocketRoute | 5 | from starlette.routing import Host, Route, WebSocketRoute, Mount |
| 6 | 6 | ||
| 7 | from authentication.endpoints import authentication, oauth | ||
| 7 | from proxy import app as proxy_app | 8 | from proxy import app as proxy_app |
| 8 | from ttun_server.endpoints import health, base_endpoints | 9 | from ttun_server.endpoints import health |
| 9 | from ttun_server.websockets import tunnel | 10 | from ttun_server.websockets import tunnel |
| 10 | 11 | ||
| 11 | logging.basicConfig(level=getattr(logging, os.environ.get('LOG_LEVEL', 'INFO'))) | 12 | logging.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'))) | |||
| 13 | app = FastAPI( | 14 | app = 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) |
