Skip to content

shimels1/simple-flask-REST-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Flask REST API

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.

Features

  • Basic RESTful API endpoints
  • Dockerized for easy deployment
  • Modular project structure
  • Dependency management via requirements.txt

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/shimels1/simple-flask-REST-API.git
    cd simple-flask-REST-API

  1. Create and activate a virtual environment (recommended):

    python3 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate

  1. Install dependencies:

    pip install -r requirements.txt

  1. Run the application:

    python app.py

The API will be accessible at http://localhost:5000/.

Docker Deployment

To run the application inside a Docker container:

  1. Build the Docker image:

    docker build -t simple-flask-api .

  1. Run the Docker container:

    docker run -p 5000:5000 simple-flask-api

The API will be accessible at http://localhost:5000/.

Project Structure

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

API Endpoints

*(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.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published