A simple Flask-based RESTful API for managing brand names using Redisearch.
Getting Started
Prerequisites
- Python 3.x
- Redis with Redisearch module installed
Installation
- Clone the repository:
git clone https://github.com/yourusername/brand-name-api.git
cd brand-name-api
- Install the required Python packages:
pip install -r requirements.txt
- Ensure Redis is running and has the Redisearch module enabled.
Running the Application Start the Flask application:
python app.py
The API will be available at http://127.0.0.1:5000.
API Endpoints
- POST /brands: Add a new brand.
- DELETE /brands/: Delete a brand by ID.
- PUT /brands/: Update a brand's name by ID.
- GET /brands/search?q=: Search for brands by name.
Example Requests
- Add a Brand:
curl -X POST http://127.0.0.1:5000/brands -H "Content-Type: application/json" -d '{"id": "1", "name": "Nike"}'
- Search for Brands:
curl -X GET "http://127.0.0.1:5000/brands/search?q=Nike"
License This project is licensed under the MIT License - see the LICENSE file for details.