[NodeJS | Express | MongoDB]
-
Install project dependencies
npm install
-
Provide MongoDB connection string in .env.sample file in project root
(rename .env.sample to .env)
-
Start the API server
npm start
https://parking-api-test.herokuapp.com/api/v1/
HTTP Method | Endpoint | Description | Body |
---|---|---|---|
POST | /register | User Registration | - email string - firstName string - lastName string - registrationNumber string -userCategory number [0 (General) or 1 (Reserved)] password string |
POST | /book | Book a parking slot | - email string - password string |
GET | /users | Total registered users (count) | |
GET | /users/list | Full list of registered users | |
GET | /parking | Status/Count of Parking slots | |
GET | /parking/availableslots | List of all available parking slots | |
GET | /parking/occupiedslots | List of all occupied parking slots |
{
"email": "john@gmail.com",
"firstName": "John",
"lastName": "Doe",
"registrationNumber": "MH-1234-5678",
"userCategory": "1",
"password": "yourpassword"
}
{
"email": "john@gmail.com",
"password": "yourpassword"
}