-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (32 loc) · 1.08 KB
/
Copy pathmain.py
File metadata and controls
39 lines (32 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.api.routes import router as api_router
from app.config.settings import settings
from app.utils.logger import get_logger
logger = get_logger(__name__)
app = FastAPI(
title="Sentinel AI Lite API",
description="Sentinel AI Lite is an autonomous code security & risk intelligence platform for Python repositories.",
version="1.0.0"
)
# Enable CORS for future frontend integration
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Include API Router
app.include_router(api_router, prefix="/api/v1")
# Route root requests to health check
@app.get("/")
def read_root():
return {
"message": "Welcome to Sentinel AI Lite API. Use POST /api/v1/analyze to scan repositories.",
"documentation": "/docs"
}
if __name__ == "__main__":
logger.info("Starting Sentinel AI Lite server on http://127.0.0.1:8000")
uvicorn.run("main:app", host="127.0.0.1", port=8000, reload=True)