Customizable Caching API Task: Create an API layer with the following endpoints:
- POST /cache → Stores a key-value pair.
- GET /cache/{key} → Retrieves a value (if exists).
- DELETE /cache/{key} → Remove from cache.
Requirements:
It should have a predefined max size. e.g. If max size is set to 10, no more items should be stored further and future POST requests should return an error.
API Link for API documentation please visit API Documentation
- Clone the repository
git clone [email protected]:dexter-ifti/my-cache.git
configure `.env` file like `.env.example`if you want to use redis locally then in cache.js simply create a new instance of redis client like this
const redisClient = redis.createClient();- Run
npm install - Run
npm run dev