-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathmain.py
More file actions
24 lines (20 loc) · 702 Bytes
/
Copy pathmain.py
File metadata and controls
24 lines (20 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from fastapi import FastAPI
from fastapi.exceptions import HTTPException
from starlette.staticfiles import StaticFiles
from fastapi.middleware.cors import CORSMiddleware
from uvicorn import run
from app.api.v1 import proxy, attack
app = FastAPI()
origins = ["*"]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.mount("/Web", StaticFiles(directory="Web"), name="Web")
app.include_router(proxy.router, prefix="/v1/proxy", tags=["proxy"])
app.include_router(attack.router, prefix="/v1/attack", tags=["attack"])
if __name__ == '__main__':
run("main:app", host="0.0.0.0", port=8000, reload=True)