28 lines
559 B
Python
28 lines
559 B
Python
|
|
"""FastAPI micro-service — entry point."""
|
||
|
|
|
||
|
|
from fastapi import FastAPI
|
||
|
|
from fastapi.middleware.cors import CORSMiddleware
|
||
|
|
|
||
|
|
from app.routes import router
|
||
|
|
|
||
|
|
app = FastAPI(
|
||
|
|
title="Micro-API",
|
||
|
|
description="Micro-services API — lightweight, scalable foundation.",
|
||
|
|
version="0.1.0",
|
||
|
|
)
|
||
|
|
|
||
|
|
app.add_middleware(
|
||
|
|
CORSMiddleware,
|
||
|
|
allow_origins=["*"],
|
||
|
|
allow_credentials=True,
|
||
|
|
allow_methods=["*"],
|
||
|
|
allow_headers=["*"],
|
||
|
|
)
|
||
|
|
|
||
|
|
app.include_router(router)
|
||
|
|
|
||
|
|
|
||
|
|
@app.get("/")
|
||
|
|
async def root():
|
||
|
|
return {"service": "micro-api", "status": "running"}
|