https://github.com/ohimoiza1205/restful-microservice
A project to showcase how to set up, develop, and deploy a RESTful microservice using Python's Flask framework.
https://github.com/ohimoiza1205/restful-microservice
flask microservices python restful-api
Last synced: 2 months ago
JSON representation
A project to showcase how to set up, develop, and deploy a RESTful microservice using Python's Flask framework.
- Host: GitHub
- URL: https://github.com/ohimoiza1205/restful-microservice
- Owner: Ohimoiza1205
- License: mit
- Created: 2024-07-21T06:14:18.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-21T07:33:56.000Z (almost 2 years ago)
- Last Synced: 2025-04-03T07:23:21.801Z (about 1 year ago)
- Topics: flask, microservices, python, restful-api
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Developing a RESTful micro service in Python
# RESTful Microservice with Flask
This project demonstrates how to build a RESTful microservice using Flask, a lightweight web server that makes it easy to develop and deploy Python-based microservices.
## Getting Started
### Prerequisites
- Python 3.x
- Pip (Python package installer)
### Installation
1. Clone the repository:
```bash
git clone https://github.com/Ohimoiza1205/RESTful-Microservice.git
cd RESTful-Microservice
2. Install Flask:
pip install flask
## Running the Application
- Navigate to the project directory.
- Start the Flask server:
python atelier.py
- The server will be available at http://127.0.0.1:5000.
## REST Endpoints
- GET /search: Returns the search page.
- POST /api/greet: Accepts a JSON body with a name field and returns a greeting message.
## Testing Your API
- You can test your API using curl, Postman, or a web browser.
- **For a GET Request**:
```bash
curl http://127.0.0.1:5000/api/hello
- **For a POST Request**:
```bash
curl -X POST http://127.0.0.1:5000/api/greet -H "Content-Type: application/json" -d '{"name": "Alice"}'