This project stores the source code for Giftcards backend.
- NodeJs
- Express.js
- Passport.js
The project is composed by six (6) main folders.
routesto handle all the requests and responses.utilsto store function to reuse or helpers.publicto create the views for documentation and errors.configHandle the sessions and tokens with Passport.binto handle some server events.controllersto define the business logic. It contains all the implementations for giftcards, logistics, catalog, subscriptions, comerssia, etc.
Clone the project. Don't forget to add a SSH key to your account.
https://github.com/Puppis-Colombia/giftcardspuppis.git
Install the packages
npm install
Add the .env file to the projec root folder, add the endpoints such as the database URI, the API key and so on. Below an example. You can ask those data in the slack group. The person in charge will give you the keys.
DB_HOST=localhost
PORT=5000
URI=XXXX
OR_KEY=XXXX
ACT_DB=XXXX
API_KEY=XXXX
Run the project.
npm start
The project has the command npm run dev for unix OS and for windows npm run dev-win. This commands enable hot reloading.
The test were created using Mocha. To run the tests type and execute this command in console: npm test