-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support for other web frameworks #1
Comments
Sure! I'll move all the component building over to the composite class instead of serve. Currently Flask is just a placeholder and I wanted to move the library over to raw wsgi. Once I'm done separating out the two components I'll post an update with a how-to in this issue! |
Done! # Create our Composite pages
Pages = Composite(Homepage, About, debug = True)
from fastapi import FastAPI, Response
app = FastAPI()
# You can check all page info by printing the Composite component
print(pages)
# You can also get page info by querying it's route,
# NOTE: The routes do not contain the initial '/'
print(pages.get(''))
@app.get("/")
def root():
# By invoking run on a built page we can fetch the raw html from the dedicated builder function
source = pages.get('').run()
return Response(content=source, media_type="text/html")
@app.get("/about")
def about():
# By invoking run on a built page we can fetch the raw html from the dedicated builder function
source = pages.get('about').run()
return Response(content=source, media_type="text/html") Please do tell me if there are any other things you would like to be added/changed! |
Marking as closed due to no activity! Please do open a new issue if you have any other requests! |
Hey, sorry for not responding in time. The changes look great, but now you have the install of 2 different web frameworks in the main dependencies of the project. Would it be possible to move them to "extras" so that you can do a |
Sure, I'll look into that. I'll be starting to move it into a proper PyPi package soon. I do not recommend using the poetry deps inside this project as they are an utter mess lol. I'll fix it up for distribution soon though! |
I highly recommend checking out
https://github.com/relekang/python-semantic-release
…On Thu, Jan 13, 2022 at 6:46 AM Linkus ***@***.***> wrote:
Sure, I'll look into that. I'll be starting to move it into a proper PyPi
package soon. I do not recommend using the poetry deps inside this project
as they are an utter mess lol. I'll fix it up for distribution soon though!
—
Reply to this email directly, view it on GitHub
<#1 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC3ROJNOIIFQY7OUC3ZVN6TUV23SZANCNFSM5LGB7HDQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hey, I love the concept and implementation of this package, but I'm not fond of Flask. Would it be possible to remove flask as a dependency and instead abstract out the routing system so it can be plugged into any framework? Specifically I'd love to use this with FastAPI.
The text was updated successfully, but these errors were encountered: