main.py 634 B

1234567891011121314151617181920212223
  1. import os
  2. from os.path import join
  3. from fastapi import FastAPI
  4. from fastapi.middleware.cors import CORSMiddleware
  5. from fastapi.staticfiles import StaticFiles
  6. from db0mb3r.app.routers import attack, services, index
  7. app = FastAPI(title="db0mb3r")
  8. app.add_middleware(
  9. CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"],
  10. )
  11. app.mount(
  12. "/static", StaticFiles(directory=join(os.getcwd(), "app", "static")), name="static"
  13. )
  14. app.include_router(attack.router, prefix="/attack", tags=["attack"])
  15. app.include_router(services.router, prefix="/services", tags=["services"])
  16. app.include_router(index.router)