This project is a minimal REST API framework implemented in Python without any external dependencies. It provides a lightweight HTTP server and a simple routing mechanism to handle basic CRUD operations.
- 🚀 Lightweight: No external libraries required.
- 🔧 Simple Routing: Easy to define routes with
GET
andPOST
methods. - 📄 JSON Responses: Automatically formats responses in JSON.
- 💡 Customizable: Add your own endpoints with minimal effort.
- 🌍 Open Source: Licensed under MIT for flexibility and reusability.
git clone https://github.com/YOUR_USERNAME/Minimal-Rest-Api-Framework.git
cd Minimal-Rest-Api-Framework
python minimal_rest_framework.py
The framework comes with a few pre-defined routes. Below is a summary of the available endpoints:
- Description: Returns a welcome message.
- Response:
{
"message": "Welcome to the Minimal REST Framework!"
}
You can add custom routes to the framework by using the @app.route()
decorator. Here’s an example:
@app.route("/new-endpoint", method="GET")
def new_endpoint():
return {"message": "This is a new custom endpoint!"}
Add this function to the minimal_rest_framework.py
file and restart the server to make the new endpoint available.
curl -X GET http://127.0.0.1:5000/data
Response:
{
"data": [1, 2, 3, 4, 5]
}
curl -X POST http://127.0.0.1:5000/info
Response:
{
"status": "Information saved successfully!"
}
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
- Fork the repository.
- Create a feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -m 'Add a new feature'
- Push to the branch:
git push origin feature-name
- Open a pull request.
- GitHub: ca1ik
- Email: [email protected]
This project is designed for small projects, quick prototyping, and learning Python fundamentals.
-
Add support for
PUT
andDELETE
methods. -
Enable XML response format.
-
Add multilingual support for localization.
If you enjoy this project, consider starring it on GitHub or contributing to its development!