A lightweight RESTful API built with Flask, designed for simplicity and ease of deployment. Now enhanced with Docker support for consistent environment setup and streamlined deployment.
- Basic RESTful API endpoints
- Dockerized for easy deployment
- Modular project structure
- Dependency management via
requirements.txt
- Python 3.7+
- Docker (optional, for containerized deployment)
-
Clone the repository:
git clone https://github.com/shimels1/simple-flask-REST-API.git cd simple-flask-REST-API
-
Create and activate a virtual environment (recommended):
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python app.py
The API will be accessible at http://localhost:5000/.
To run the application inside a Docker container:
-
Build the Docker image:
docker build -t simple-flask-api .
-
Run the Docker container:
docker run -p 5000:5000 simple-flask-api
The API will be accessible at http://localhost:5000/.
simple-flask-REST-API/
├── api/
│ └── ... # API endpoint definitions
├── app.py # Main application entry point
├── requirements.txt # Project dependencies
├── Dockerfile # Docker configuration
└── .dockerignore # Files to exclude from Docker build
*(Note: Replace the following with actual endpoints implemented in your api/ module.)*
POST /addition- To add two numbers.POST /subtraction- To subtract the second number from the first.POST /multiplication- To multiply two numbers.POST /division- To divide the first number by the second.
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License.