Simple NodeJS API with Elasticsearch and Redis
- Node.js v16+
- Docker & Docker Compose
- Optional: local Elasticsearch & Redis for development without Docker
Clone repository
git clone https://github.com/alitinart/elasticsearch-nodejsdocker compose up --buildMake sure to create and setup a .env file.
In there you must include:
- ELASTIC_SEARCH_HOST
- REDIS_HOST
- CACHE_TIME
Run the API via terminal using:
npm start| Method | Endpoint | Description |
|---|---|---|
| GET | /api/recipes/search?q=<query> |
Search recipes by title, ingredients, or tags |
| POST | /api/recipes |
Create a new recipe |
| POST | /api/recipes/bulk |
Bulk create multiple recipes |
| PATCH | /api/recipes/:id |
Update a recipe by ID |
| DELETE | /api/recipes/:id |
Delete a recipe by ID |