Initial commit

This commit is contained in:
2026-09-04 20:55:42 +03:00
commit 34d40fc219
52 changed files with 3967 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from api.auth import router as auth_router
from api.orders import router as orders_router # <-- Добавили импорт роутера заказов
from core.database import engine, Base
# Автоматическое создание таблиц в SQLite при старте
Base.metadata.create_all(bind=engine)
app = FastAPI(title="Fiscal Automation API", version="1.0.0")
# Подключение роутеров
app.include_router(auth_router)
app.include_router(orders_router) # <-- Подключили роутер заказов
# Настройка CORS
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:5173"], # адрес вашего React
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/")
def root():
return {"status": "running", "service": "Fiscal Automation API"}