- NodeJS
- Express
- Sequelize
- PostgreSQL
The easiest way to get started is to clone the repository:
git clone https://github.com/melitus/car-booking-api.git
cd car-booking-api
yarn install
yarn run dev
Note: It is recommended to install nodemon for livereloading - It watches for any changes in your node.js app and automatically restarts the server
-
Download and install Heroku CLI
-
In a terminal, run
heroku login
and enter your Heroku credentials -
From your app directory run
heroku create
-
Use the command
heroku config:set KEY=val
to set the different environment variables (KEY=val) for your application (i.e.heroku config:set BASE_URL=[heroku App Name].herokuapp.com
etc.) -
Do
git add .
-
Do
git commit -m" reason for commit"
-
Lastly, do
git push heroku master
.
Please note that you may also use the Herko Dashboard to set or modify the configurations for your application.
I used postman to test the api. To use postman, go to the project doc folder and import the docs file into your postman client to ease the testing
- Login -
https://car-booking-backend.herokuapp.com/v1/api/user/login
- Register -
https://car-booking-backend.herokuapp.com/v1/api/user/register
-
Get all cars -
https://car-booking-backend.herokuapp.com/v1/api/booking?pagesize=10&pagenumber=1
-
Book a car -
https://car-booking-backend.herokuapp.com/v1/api/booking
-
Get previous booking filtered by user -
https://car-booking-backend.herokuapp.com/v1/api/booking/24d551b9-6845-443a-ba9e-de18dd0b4fec/previous?pagesize=10&pagenumber=1