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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Any example or plan to integrate exist api service #536

Open
thinker007 opened this issue Oct 21, 2024 · 2 comments
Open

[FEATURE] Any example or plan to integrate exist api service #536

thinker007 opened this issue Oct 21, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@thinker007
Copy link

If you'd like to discuss your feature idea first with the community (highly recommended!) please visit our Discord channel.

bring api to website
not database。

using api build fasthtml website

@thinker007 thinker007 added the enhancement New feature or request label Oct 21, 2024
@muhis
Copy link

muhis commented Oct 21, 2024

I fail to see why you can't achieve this with python code.

from fasthtml.common import *
import requests

app,rt = fast_app()

@rt('/')
def get():
response = requests.get("https://api.sampleapis.com/coffee/hot").  # << Make request
return Div(P(f'Hello World! {response.content}'), hx_get="/change")  # << Use API  response in user response

serve()

@pydanny
Copy link
Collaborator

pydanny commented Oct 28, 2024

@thinker007 Is there a particular API service you are suggesting? That would functionality that would justify this kind of third-party dependency?

Otherwise @muhis is correct, this is something that individual projects should do on their own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants