ba-thesis/backend/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.
"""
2023-05-10 16:19:38 +01:00
from fastapi import FastAPI
from backend import config
from backend.routes.devices import router as devices_router
from backend.routes.devices import tag_metadata as devices_tags
from backend.routes.users import router as users_router
from backend.routes.users import tag_metadata as users_tags
from backend.routes.records import router as records_router
from backend.routes.records import tag_metadata as records_tags
s = config.get_settings()
app = FastAPI(
title=f"{s.app_name} backend API",
description=f"This is the backend server API for {s.app_name}, a remote patient monitoring and early warning system.",
version=f"{s.app_version}",
contact={
"name": f"{s.contact_name}",
"email": f"{s.contact_email}",
"url": f"{s.contact_url}",
},
openapi_tags=[
users_tags,
devices_tags,
records_tags,
],
)
app.include_router(devices_router)
app.include_router(users_router)
app.include_router(records_router)
2023-05-12 03:59:05 +01:00
2023-05-10 16:19:38 +01:00
@app.get("/hello/")
2023-05-12 03:59:05 +01:00
def hello():
"""Placeholder for a proper healthcheck endpoint."""
2023-05-10 16:19:38 +01:00
return "Hello World!"