Init files
This commit is contained in:
32
main.py
Normal file
32
main.py
Normal file
@ -0,0 +1,32 @@
|
||||
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)
|
Reference in New Issue
Block a user