You've already forked Promocode-API
mirror of
https://github.com/devitq/Promocode-API.git
synced 2026-05-23 21:27:12 +00:00
init: initialized project struct
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
from functools import partial
|
||||
|
||||
from ninja import NinjaAPI
|
||||
|
||||
from api.v1 import handlers
|
||||
from api.v1.ping.views import router as ping_router
|
||||
|
||||
router = NinjaAPI(
|
||||
title="Promocode API",
|
||||
version="1",
|
||||
description="API docs for Promocode",
|
||||
openapi_url="/docs/openapi.json",
|
||||
# csrf=True, noqa: ERA001
|
||||
)
|
||||
|
||||
|
||||
# Register application's routers
|
||||
|
||||
router.add_router(
|
||||
"ping",
|
||||
ping_router,
|
||||
)
|
||||
|
||||
|
||||
# Register exception handlers
|
||||
|
||||
for exception, handler in handlers.exception_handlers:
|
||||
router.add_exception_handler(exception, partial(handler, router=router))
|
||||
Reference in New Issue
Block a user