fastapi-svelte-template/backend/todo/main.py

44 lines
1.2 KiB
Python
Raw Normal View History

"""Main entry point for the MEDWingS backend.
This module defines the API routes provided by the backend.
"""
from fastapi import FastAPI
from todo import config
2023-05-31 16:37:56 +01:00
from todo.routes.users import router as router_users, tag_metadata as tags_users
from todo.routes.todos import router as router_todos, tag_metadata as tags_todos
from todo.routes.auth import router as router_auth, tag_metadata as tags_auth
from todo.routes.admin import router as router_admin, tag_metadata as tags_admin
s = config.get_settings()
app = FastAPI(
title=f"{s.app_name} API",
description=f"This is the backend server API for {s.app_name}, a simple TODO-list application.",
version=f"{s.app_version}",
contact={
"name": f"{s.contact_name}",
"email": f"{s.contact_email}",
"url": f"{s.contact_url}",
},
openapi_tags=[
2023-05-31 16:37:56 +01:00
tags_users,
tags_todos,
tags_auth,
tags_admin,
],
)
2023-05-31 16:37:56 +01:00
app.include_router(router_users)
app.include_router(router_todos)
app.include_router(router_auth)
app.include_router(router_admin)
@app.get("/hello/")
def hello():
"""Placeholder for a proper healthcheck endpoint."""
return "Hello World!"