28 lines
537 B
Python
28 lines
537 B
Python
import os
|
|
from fastapi import FastAPI, HTTPException
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from routers import skills
|
|
|
|
app = FastAPI()
|
|
|
|
origins = [
|
|
"http://localhost",
|
|
"http://localhost:5173",
|
|
]
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=origins,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
@app.get("/")
|
|
def read_root():
|
|
return {"status": "API Portfolio fonctionnelle !"}
|
|
|
|
app.include_router(
|
|
skills.router,
|
|
prefix="/api/skills",
|
|
tags=["Skills"]
|
|
) |