30 lines
886 B
Python
30 lines
886 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from core.config import API_VERSION, ALLOWED_ORIGINS
|
|
from database.connection import engine
|
|
from database.models import Base
|
|
from routes.router import router as system_router
|
|
from routes.upload_file_router import router as upload_router
|
|
from routes.auth_router import router as auth_router
|
|
|
|
app = FastAPI(
|
|
title="ETL Geo Upload Service",
|
|
version=API_VERSION,
|
|
description="Upload Automation API"
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=ALLOWED_ORIGINS,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
Base.metadata.create_all(bind=engine)
|
|
|
|
# Register routers
|
|
app.include_router(system_router, tags=["System"])
|
|
app.include_router(auth_router, prefix="/auth", tags=["Auth"])
|
|
app.include_router(upload_router, prefix="/upload", tags=["Upload"])
|