RouteX is a Frappe app that enhances API routing by introducing RESTful endpoints alongside Frappe’s default dotted path approach. It provides a more intuitive and flexible way to define and manage API routes in Frappe applications.
|
|
|
- Python 3.11 or higher
- Frappe
# Install RouteX
bench get-app https://github.com/niraj2477/routex
bench install-app routex# Use routex_whitelist function to add your route, In this example we are are defineing a route name "foo" that will be accessible via /api/[app-name]/foo
@routex_whitelist("/foo")
def foo():
return "bar"GROUPED ROUTE
# For grouping the routes we have parameter which can be passed, which will group the routes. eg. /api/[app-name]/group/foo
@routex_whitelist("/foo",group="/group")
def foo():
return "bar"routex_whitelist does supports all the params supported by the whitelist, since using routex method will automatically registers the api with frappe.whitelist.
- 🐛 Report issues
- 💬 Discussions
- 🌟 Star us on GitHub!