Skip to content

ca1ik/Minimal-Rest-Api-Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MINIMAL REST API FRAMEWORK


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.


🌟 FEATURES

  • 🚀 Lightweight: No external libraries required.
  • 🔧 Simple Routing: Easy to define routes with GET and POST 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.

📦 INSTALLATION

Clone the repository:

git clone https://github.com/YOUR_USERNAME/Minimal-Rest-Api-Framework.git
cd Minimal-Rest-Api-Framework

Ensure you have Python 3 installed on your system.

Run the server:

python minimal_rest_framework.py

🚦 QUICK START

The framework comes with a few pre-defined routes. Below is a summary of the available endpoints:

GET /

  • Description: Returns a welcome message.
  • Response:
{
    "message": "Welcome to the Minimal REST Framework!"
}

🛠️ CUSTOMIZING THE 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.


🔍 EXAMPLE USAGE

Fetching Data (GET /data)

curl -X GET http://127.0.0.1:5000/data

Response:

{
    "data": [1, 2, 3, 4, 5]
}

Saving Information (POST /info)

curl -X POST http://127.0.0.1:5000/info

Response:

{
    "status": "Information saved successfully!"
}

🛡️ LICENSE

This project is licensed under the MIT License. See the LICENSE file for details.


🤝 CONTRIBUTION

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

  1. Fork the repository.
  2. Create a feature branch:
git checkout -b feature-name
  1. Commit your changes:
git commit -m 'Add a new feature'
  1. Push to the branch:
git push origin feature-name
  1. Open a pull request.

🌐 CONNECT


📸 SCREENSHOTS

Welcome Endpoint

Data Endpoint


🔮 ENHANCEMENTS

Purpose:

This project is designed for small projects, quick prototyping, and learning Python fundamentals.

Roadmap:

  • Add support for PUT and DELETE methods.

  • Enable XML response format.

  • Add multilingual support for localization.

Support:

If you enjoy this project, consider starring it on GitHub or contributing to its development!


🎉 THANK YOU FOR USING MINIMAL REST API FRAMEWORK!


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages