Skip to content

Modularize models and handlers  #486

Closed as not planned
Closed as not planned

Description

@stan-dot

image

split handler into multiple different classes, DeviceHandler, TasksHandler, etc

Optionally also to the router like this:

`from fastapi import FastAPI
from tasks.router import router as tasks_router
from devices.router import router as devices_router
from plans.router import router as plans_router

app = FastAPI()

app.include_router(tasks_router, prefix="/api")
app.include_router(devices_router, prefix="/api")
app.include_router(plans_router, prefix="/api")

if name == "main":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)
`

Activity

  1. callumforrester commented on May 24, 2024

    @callumforrester
    Contributor

    Duplicate of #434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: rest api

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions