Skip to content

Latest commit

 

History

History
122 lines (80 loc) · 2.78 KB

README.md

File metadata and controls

122 lines (80 loc) · 2.78 KB

CVE-API

Gitter

Table of contents

Technologies

This project uses or depends on software from

Style Guidelines

This project uses the following Style Guidelines

Directory layout

Top Level Directory

.
├── src                     # Source files (This is where the API resides)
├── test                    # Automated tests (This is where the API tests reside)
├── LICENSE
└── README.md               

Src Directory

.
├── ...
├── src                     # Source files (This is where the API resides)
│   ├── controller/         # All API logic resides here.
│   ├── model/              # All Mongoose Schemas, models, and database logic.
│   ├── middleware/         # Authentication middleware resides inside this folder. 
│   ├── routes.config.js    # This is where routes get created and get tied back to their specific controller. 
│   └── index.js            # Where everything begins.
└── ...

Setup

Step 1. Install required node modules

This assumes the latest node and npm are installed.

cd cve-services
npm install

Step 2. Setup and start MongoDB locally

Install MongoDB locally

Download MongoDB Compass (MongoDB GUI)

Step 3. Start the node application

In order to start a dev enviorment:

npm run start:dev

Unit Testing

This project uses the following for unit testing

Before running the unit tests, change the NODE_ENV variable in the .env file from dev to test.

Use the following command to run the unit tests:

npm run start:test

In order to view server logs and to stop server

To view logs:

pm2 logs

To stop the server

pm2 stop all