56 lines
1.2 KiB
Python
56 lines
1.2 KiB
Python
from fastapi import FastAPI, Depends, HTTPException, status
|
||
from fastapi.middleware import Middleware
|
||
from fastapi.middleware.cors import CORSMiddleware
|
||
|
||
from kv import kv
|
||
from auth import auth
|
||
from kassa import kassa
|
||
from isjkhrs import ismain
|
||
import uvicorn
|
||
|
||
middleware = [Middleware(
|
||
CORSMiddleware,
|
||
allow_origins=['*'],
|
||
allow_credentials=True,
|
||
allow_methods=['*'],
|
||
allow_headers=['*'],
|
||
)]
|
||
|
||
app = FastAPI( middleware=middleware)
|
||
|
||
|
||
@app.get('/hello')
|
||
async def say_hello():
|
||
return {"text": "Hello!"}
|
||
|
||
app.include_router(
|
||
router=auth.router,
|
||
prefix='/auth',
|
||
tags=['Авторизация'],
|
||
responses={404: {"description": "Not found"}}
|
||
)
|
||
|
||
app.include_router(
|
||
router=kv.router,
|
||
prefix='/kv',
|
||
tags=['Кварплата'],
|
||
responses={404: {"description": "Not found"}}
|
||
)
|
||
|
||
|
||
app.include_router(
|
||
router=ismain.router,
|
||
prefix='/is',
|
||
tags=['Информационная система'],
|
||
responses={404: {"description": "Not found"}}
|
||
)
|
||
app.include_router(
|
||
router=kassa.router,
|
||
prefix='/kassa',
|
||
tags=['Касса Атол'],
|
||
responses={404: {"description": "Not found"}}
|
||
)
|
||
|
||
if __name__ == "__main__":
|
||
uvicorn.run("main:app", host="0.0.0.0", port=4321, reload = True)
|