Create restful APIs for a practical test for fullstack javascript developer with experience in Vue, Node.js, Express, MongoDB, and Swagger.
- Install Node if you do not have it already.
- Install MongoDB if you do not have it already.
- Clone the repo
git clone https://github.com/Odumz/clientelleAPI.git - Create a env file by running
touch .env - Copy the fields from
sample_envand replace with correct fields in your.envfile. - Install all dependencies by running
npm install || npm i - Seed the database by running
npm run seed
Run npm run dev to start the development server. It will automatically rebuild the app upon file change.
local url for development: http://localhost:5000 //or PORT
Run npm run build to start the production server.
Run npm run test in the terminal to run the tests.
- Click on this link to open the hosted swagger documentation
- Change the schemes to
httpsand click onTry it outto execute the request
- Click on this link or copy and paste
http://localhost:PORT/api-docsto your browser to open the local swagger documentation where port is your defined port variable in the env file. - Change the schemes to
httpand click onTry it outto execute the request
- Click on this link to download and install postman for your system if you do not have it already.
- Open the postman application and click on
Importto import the postman collection. - Click on
Importand select theLinkfrom the options. - Copy this link
https://www.getpostman.com/collections/e10623717c805eca5c0aand paste it in theLinkfield. - Click on
Continueto finish import and it will automatically open the postman collection.
Postman environment variables:
{{ URL }} : http://localhost:5000 //or PORT - local url for development
{{ URL_API }} : http://localhost:5000/api/v1 //or PORT/api/v1 - local api url for development
{{ LURL }} : https://clientelle.herokuapp.com - live url for development
{{ LURL_API }} : https://clientelle.herokuapp.com/api/v1 - live api url for development