Replies: 1 comment
-
NiceGUI also wants to establish a websocket connection. Maybe, through the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Context
I want to integrate an existing FastAPI to niceGUI. The application runs behind a proxy configured with nginx.
I also need a login prior to granting access to the application, so the authentification and Fastapi examples looked like a good start. However I am encountering persisting errors with the starlette handling of middleware.
Architecture
The project is organized this way:
In the makefile, I run the command :
as suggested here
main.py
The main file basically reproduces the fastapi examples, with the root_path specified for communication behind the proxy :
frontend.py
The frontend mixes the authentification and fastapi examples :
Notice those critical changes : I had to add
mount_path
prefix to both unrestricted pages url and /_nicegui files url indispatch()
, so that the proxy resolves correctly both the app and the niceGUI static files without entering e.g. infinite redirection to /project/login, or 404 errors.The error
The website shows correctly. However no interactive feature (e.g. toggle or login button) work and this error message pops up on the server side in a loop :
Sorry for the gigantic issue report, but this seemed to me more important than the scope of my only project. I hope I am simply doing something wrong! Best regards to the entire team.
Beta Was this translation helpful? Give feedback.
All reactions