Note: This project uses no database. It only showcases the REST API implementation.
Install my-project with yarn. The following command will create node_modules and yarn.lock file.
yarn
The following command will start the dev server.
yarn dev
To run all the test cases, run the following command. Implemented test with Jest and Supertest.
npm run test
GET /api/v1/car/:carNumber
GET /api/v1/slot/:slotNumber
POST /api/v1/car
Request Body
{
"carNo": 4567
}
DELETE /api/v1/car/:carNumber
I have never implemented rate limiter before. So, did some research for that.
Did not use any external package.
Initially I implemented the rate limiter with redis to store the request count value.
But then, Removed the redis implementation and implemented it manually.
User can't request more than 10 times in 10 seconds.