restipie
restipie copied to clipboard
Extend instead of Fork
As mentioned in the README, this app relies on forking Frappe to get stuff to work. I would suggest doing so by using the Dynamic Pages functionality instead (ref: https://frappeframework.com/docs/v13/user/en/guides/portal-development/context)
You can create a file v1.py and a corresponding base template file v1.html to handle all requests to /v1. The HTML file may be empty.
You can add something that looks like the following under restpie/www/v1.py:
from restipie.restipie import request_handler
def get_context(context):
return request_handler(context)
Very good point, the approach to explicitly modify the app.py in frappe is actually just a workaround since I couldn't see any other way to reroute the request by the time of creating this. I will find time and look into your suggestion, for now I will leave it as is. Thank you!