Skip to content

Suggestion for migrating from pure fastapi project #4145

Answered by rodja
zihaom asked this question in Q&A
Discussion options

You must be logged in to vote

Can I pass data (say a pd dataframe) between a fastapi api to the nicegui page?

Yes.

Since nicegui is wrapped around fastapi, is there any point of keeping the old fastapi stuff? like db, schemas, ui.run_with, and just use ui.run()?

You are right. When migrating from a pure FastAPI implementation, it might me cleaner/easier to just remove your own app instantiation and use from nicegui import app instead to register the non-UI routes.

In addition, where does the binding of the frontend apis (e.g. show()) happen? during run with? If I want to separate the different pages and import them in frontend.py how would I do it?

Have a look at our modularization example.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@zihaom
Comment options

Answer selected by zihaom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants