ludic
ludic copied to clipboard
Add helpers and write documentation on how to embed the framework in an existing fastapi app
Hi, thank you for taking an interest in the framework.
I was already trying to integrate the framework in FastAPI, but it requires some tweaking and I haven't finished it yet.
Right now, your only option is to do something like this in FastAPI endpoints:
from fastapi import FastAPI
from ludic.html import p, b
from ludic.web.responses import LudicResponse
app = FastAPI()
@app.get("/")
def read_root() -> LudicResponse:
content = p("Hello ", b("World"))
return LudicResponse(content)
Wondering also for Django...
@Mte90 I have an open issue for that - https://github.com/paveldedik/ludic/issues/13
But first, I want to have a better integration for FastAPI. These are now one of my top priority issues, so hopefully, I'll check it soon.
Ops I missed that issue