2023-05-12 13:11:32 +01:00
|
|
|
"""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
|
|
|
|
2023-05-13 01:54:04 +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
|
2023-05-15 09:34:31 +01:00
|
|
|
from backend.routes.records import router as records_router
|
|
|
|
from backend.routes.records import tag_metadata as records_tags
|
2023-05-13 01:54:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
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,
|
2023-05-15 09:34:31 +01:00
|
|
|
records_tags,
|
2023-05-13 01:54:04 +01:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
app.include_router(devices_router)
|
|
|
|
app.include_router(users_router)
|
2023-05-15 09:34:31 +01:00
|
|
|
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():
|
2023-05-12 13:11:32 +01:00
|
|
|
"""Placeholder for a proper healthcheck endpoint."""
|
|
|
|
|
2023-05-10 16:19:38 +01:00
|
|
|
return "Hello World!"
|