System using Node with Express Server, MongoDB
- Express
- REST API
.
├── server.js
├── package.json
├── api
| ├── routes.js
│ ├── common
| └── errorModule.js
│ └── parking
| └── v1
| └── index.js
| └── parking.js
| └── users
| └── v1
| └── index.js
| └── users.js
├── models
│ ├── BookModel.js
│ └── UserModel.js
├── components
| └── parking
| └── index.js
| └── addParkingSlot.js
| └── bookParkingSlot.js
| └── checkBookingSlot.js
| └── checkParkingSlot.js
| └── getOccupiedSlot.js
| └── getParkingSlotList.js
│ ├── users
| └── index.js
| └── getUsersDetails.js
| └── getTotalUserRegister.js
| └── addUser.js
├── models
│ ├── User.js
│ ├── ParkingSlot.js
│ ├── BookParkingSlot.jsgit clone https://github.com/skaka30/parkingLot.gitcd parkingLotnpm installnpm run dev- optional: include .env in your .gitignore
- visit http://localhost:5500/version
- /parking/getParkingSlotList
- /parking/getOccupiedSlot/2020-10-21
- /parking/getAvailableSlot/2020-10-21
- /parking/addParkingSlot
- /parking/bookSlot
- Install Postman to interact with REST API
- Create a message with:
- URL: http://localhost:3000/v1/parking/getParkingSlotList
- Method: POST
- Body: raw + JSON (application/json)
- Body Content:
{ "status": { "code": 200, "message": "success" }, "data": { "totalParkingSlot": [ { "_id": "5f7cd5188e7a3912694a67f7", "parkingNumber": "m5", "nearByLift": "1", "reservedType": "1", "__v": 0 } ] } }