Load Multiple Falcon App in uwqsgi

35 views
Skip to first unread message

Sumit Gupta

unread,
Nov 30, 2016, 6:48:03 AM11/30/16
to Falcon Framework
Hi,

I am writing Rest in Falcon ..I have some scenario like:

Lets say i have file A.py which have some /a api and i have one more file B.py which have api /b.
And i want to load both A.py and B.py using some c.py in uwsgi...so once i launch c.py ...both API should be accessible.

Thanks
Sumit 

Kurt G. | @kgriffs

unread,
Dec 2, 2016, 3:43:22 PM12/2/16
to Falcon Framework
Hi Sumit, I haven't tried this myself, but these instructions for Flask should be applicable to Falcon, since instances of falcon.API are just WSGI callables (as are instances of flask.Flask):

https://uwsgi-docs.readthedocs.io/en/latest/Snippets.html#multiple-flask-apps-in-different-mountpoints

Within your Falcon app, req.path will not include the mount point (SCRIPT_NAME) prefix, so your routes don't need to include it. However, if you need to, you can access the prefix via req.app, and properties such as req.uri will include SCRIPT_NAME to derive the full path.

Hope that helps! Let me know how it goes.

@kgriffs
Reply all
Reply to author
Forward
0 new messages