Routex

Rest API compatible routes for Frappe

Install Routex

bench get-app https://github.com/niraj2477/routex

Tags

  • frappe

Add the Frappe Gems badge to your README

Maintain Routex? Paste this into your README:

[![Listed on Frappe Gems](https://frappegems.com/api/method/frappe_gems.seo.badge?app=niraj2477%2Froutex)](https://frappegems.com/gems/apps/niraj2477/routex)

About Routex

RouteX Logo
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) [![License: AGPL3.0](https://img.shields.io/badge/license-AGPL--v3-blue)](https://opensource.org/license/agpl-v3) ### Rest API compatible routes for Frappe _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._ [Quick Start](#-quick-start) • [Examples](#-examples) • [Support](#-support)
## ✨ Features

RestAPI compatible

- Fully supports RESTful principles, making it easy to integrate with external services. - Supports slashed path-based routing (e.g., /api/app-name/) instead of Frappe’s dotted path convention for cleaner and more intuitive URLs.

Grouped Routes

- Organize multiple related API endpoints under a single namespace. - Helps maintain cleaner, more structured API management.

Custom route names

- Allows defining human-readable and meaningful route names. - Enhances debugging and logging by providing easily identifiable route identifiers.
## 🛠️ Requirements - Python 3.11 or higher - Frappe ## 🚀 Quick Start ```bash # Install RouteX bench get-app https://github.com/niraj2477/routex bench install-app routex ``` ## 📚 Examples ### Usage ```python # 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** ```python # 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`. ## 🤝 Support - 🐛 [Report issues](https://github.com/niraj2477/routex/issues) - 💬 [Discussions](https://github.com/niraj2477/routex/discussions) - 🌟 Star us on GitHub! ## 👏 authors [@elifvish](https://github.com/elifvish) [@niraj2477](https://gihub.com/niraj2477) [@dhsathiya](https://github.com/dhsathiya)

Related Developer Tools apps for Frappe & ERPNext

  • Frappe — Low code web framework for real world applications, in Python and Javascript
  • Frappe Docker — Docker environment for developing, deploying, and running Frappe applications (ERPNext and custom apps) in production and development
  • Builder — Craft beautiful websites effortlessly with an intuitive visual builder and publish them instantly
  • Bench — CLI to manage Multi-tenant deployments for Frappe apps
  • Frappe Ui — A set of components and utilities for rapid UI development
  • Press — Full service cloud hosting for the Frappe stack - powers Frappe Cloud
  • Gameplan — Open Source Discussions Platform for Remote Teams
  • Doppio — A Frappe app (CLI) to magically setup single page applications and Vue/React powered desk pages on your custom Frappe apps.