|
|
@@ -6,7 +6,7 @@ from fastapi import FastAPI, Request
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse
|
|
|
from starlette.middleware.base import BaseHTTPMiddleware
|
|
|
-from room_cal.api._routes import services, calc, chat, credentials, prices, reservations, closed, discounts, actions, workflows, health, reload, sms
|
|
|
+from room_cal.api._routes import services, calc, chat, credentials, prices, reservations, closed, discounts, actions, workflows, health, reload, sms, busy
|
|
|
import os
|
|
|
from room_cal.api._auth import router as auth_router, get_user, AUTH_DISABLED
|
|
|
from room_cal._health import run_health_loop
|
|
|
@@ -21,7 +21,7 @@ def _render(path: Path) -> str:
|
|
|
return path.read_text().replace("const API_BASE = '';", f"const API_BASE = '{_API_BASE}';", 1)
|
|
|
|
|
|
_HTML_PATHS = {'/dev', '/calendar', '/calc'}
|
|
|
-_PUBLIC_PREFIXES = ('/auth/', '/calc', '/health', '/sms/')
|
|
|
+_PUBLIC_PREFIXES = ('/auth/', '/calc', '/health', '/sms/', '/busy')
|
|
|
_OPEN_PATHS = {'/docs', '/openapi.json', '/redoc'}
|
|
|
|
|
|
|
|
|
@@ -70,7 +70,7 @@ def create_app() -> FastAPI:
|
|
|
app.add_middleware(CORSMiddleware, allow_origins=['*'], allow_methods=['*'], allow_headers=['*'])
|
|
|
app.add_middleware(_AuthMiddleware)
|
|
|
app.include_router(auth_router)
|
|
|
- for mod in (services, calc, chat, credentials, prices, reservations, closed, discounts, actions, workflows, health, reload, sms):
|
|
|
+ for mod in (services, calc, chat, credentials, prices, reservations, closed, discounts, actions, workflows, health, reload, sms, busy):
|
|
|
app.include_router(mod.router)
|
|
|
|
|
|
@app.get('/dev', response_class=HTMLResponse, include_in_schema=False)
|