adding /api to all paths
Browse files- backend/main.py +10 -7
backend/main.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
from contextlib import asynccontextmanager
|
| 2 |
-
from fastapi import FastAPI
|
| 3 |
from fastapi.middleware.cors import CORSMiddleware
|
| 4 |
import os
|
| 5 |
|
|
@@ -33,7 +33,7 @@ app = FastAPI(
|
|
| 33 |
title=settings.app_name,
|
| 34 |
description=settings.app_description,
|
| 35 |
version=settings.app_version,
|
| 36 |
-
lifespan=lifespan
|
| 37 |
)
|
| 38 |
|
| 39 |
# Configure CORS for frontend dev server(s)
|
|
@@ -47,12 +47,15 @@ app.add_middleware(
|
|
| 47 |
allow_headers=["*"],
|
| 48 |
)
|
| 49 |
|
|
|
|
| 50 |
# Include API routes
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
| 56 |
|
| 57 |
logger.info("Application routes registered")
|
| 58 |
|
|
|
|
| 1 |
from contextlib import asynccontextmanager
|
| 2 |
+
from fastapi import FastAPI, APIRouter
|
| 3 |
from fastapi.middleware.cors import CORSMiddleware
|
| 4 |
import os
|
| 5 |
|
|
|
|
| 33 |
title=settings.app_name,
|
| 34 |
description=settings.app_description,
|
| 35 |
version=settings.app_version,
|
| 36 |
+
lifespan=lifespan,
|
| 37 |
)
|
| 38 |
|
| 39 |
# Configure CORS for frontend dev server(s)
|
|
|
|
| 47 |
allow_headers=["*"],
|
| 48 |
)
|
| 49 |
|
| 50 |
+
api_router = APIRouter(prefix="/api")
|
| 51 |
# Include API routes
|
| 52 |
+
api_router.include_router(root_router)
|
| 53 |
+
api_router.include_router(user_router)
|
| 54 |
+
api_router.include_router(job_router)
|
| 55 |
+
api_router.include_router(assessment_router)
|
| 56 |
+
api_router.include_router(application_router)
|
| 57 |
+
|
| 58 |
+
app.include_router(api_router)
|
| 59 |
|
| 60 |
logger.info("Application routes registered")
|
| 61 |
|