Skip to content

Commit

Permalink
Added tortoise connection
Browse files Browse the repository at this point in the history
  • Loading branch information
KreativeThinker committed Nov 16, 2023
1 parent db9acdb commit 08e4172
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/pwncore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
import pwncore.docs as docs
import pwncore.routes as routes

from tortoise.contrib.fastapi import register_tortoise

app = FastAPI(
title="Pwncore", openapi_tags=docs.tags_metadata, description=docs.description
)

app.include_router(routes.router)

register_tortoise(
app,
db_url = "sqlite://:memory:",
modules = {"models": ["pwncore.models"]},
generate_schemas = True,
add_exception_handlers = True,
)

0 comments on commit 08e4172

Please sign in to comment.