32 lines
823 B
Python
32 lines
823 B
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
|
|
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',
|
|
responses={404: {"description": "Not found"}}
|
|
)
|
|
app.include_router(router = kv.router, prefix = '/kv',tags=['Кварплата'], responses={404: {"description": "Not found"}})
|
|
|
|
|
|
if __name__ == "__main__":
|
|
uvicorn.run("main:app", host = "0.0.0.0", port = 5000) |