Files
service-app/main.py
2022-06-16 09:38:24 +09:00

56 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)