29 lines
645 B
Python
29 lines
645 B
Python
from fastapi import FastAPI
|
|
from src.web.protected_routes.routes import router as protected_router
|
|
from pathlib import Path
|
|
import uvicorn
|
|
|
|
app=FastAPI(root_path="/")
|
|
app.include_router(router=protected_router)
|
|
|
|
@app.get("")
|
|
def root()->dict:
|
|
return {"root":"hello, this is root"}
|
|
|
|
|
|
def create_dirs():
|
|
|
|
dirs_to_create=("./DB",
|
|
"./upload",
|
|
"./upload_bad",
|
|
"./upload_finished")
|
|
|
|
for x in dirs_to_create:
|
|
Path(x).mkdir(parents=True, exist_ok=True)
|
|
|
|
def main():
|
|
create_dirs()
|
|
uvicorn.run("main:app", reload=True)
|
|
|
|
if __name__=="__main__":
|
|
main() |