Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helpers and write documentation on how to embed the framework in an existing fastapi app #12

Open
barapa opened this issue Mar 21, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@barapa
Copy link

barapa commented Mar 21, 2024

No description provided.

@paveldedik
Copy link
Owner

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)

@paveldedik paveldedik changed the title Is it possible to embed this in an existing fastapi app? Add helpers and write documentation on how to embed the framework in an existing fastapi app Mar 22, 2024
@paveldedik paveldedik added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants