Open cthoyt opened 1 year ago
Hi @cthoyt do you have a pointer to this flask app please? To have a reference
I think this documentation is what you are searching for: https://fastapi.tiangolo.com/advanced/wsgi/
You can mount the whole flask app on the FastAPI app (in your case instantiated as SparqlEndpoint
), then run everything on uvicorn
With this approach you still have your whole flask code as before, and the code to merge the flask API with the SPARQL endpoint is minimal and clear
If you prefer to really have flask at the root, it seems like flask is built on the same WSGI standard: https://flask.palletsprojects.com/en/2.2.x/deploying/gunicorn so you can probably mount the FastAPI/SparqlEndpoint app on the flask app (the same way as described in the FastAPI doc), and deploy the flask app with uvicorn/gunicorn
If you have a reference to the project I can check to see how it could be done exactly, and I'll add the process to the docs
Note that I would want to mount a fastapi app on a flask app, not the other way around
A web service I want to include a rdflib-endpoint instance in is built in Flask, can you add documentation on how to mount a
rdflib_endpoint.SparqlEndpoint
to an existingflask.Flask
that doesn't require converting everything over to FastAPI?