Skip to content

Gopher-Industries/Nutrihelp-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

473 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NutriHelp Backend API

This is the backend API for the NutriHelp project. It is a RESTful API that provides the necessary endpoints for the frontend to interact with the database.

Installation

  1. Open a terminal and navigate to the directory where you want to clone the repository.
  2. Run the following command to clone the repository:
git clone https://github.com/Gopher-Industries/Nutrihelp-api
  1. Navigate to the project directory:
cd Nutrihelp-api
  1. Install the required dependencies (including python dependencies):
npm install
pip install -r requirements.txt
npm install node-fetch
npm install --save-dev jest supertest
  1. Contact a project maintainer to get the .env file that contains the necessary environment variables and place it in the root of the project directory.
  2. Start the server:
npm start

A message should appear in the terminal saying Server running on port 80. You can now access the API at http://localhost:80.

Endpoints

The API is documented using OpenAPI 3.0, located in index.yaml. You can view the documentation by navigating to http://localhost:80/api-docs in your browser.

Automated Testing

  1. In order to run the jest test cases, make sure your package.json file has the following test script added:
"scripts": {
  "test": "jest"
}

Also, have the followiing dependency added below scripts:

"jest": {
    "testMatch": [
      "**/test/**/*.js"
    ]
  },
  1. Make sure to run the server before running the test cases.
  2. Run the test cases using jest and supertest:
npx jest .\test\<TEST_SUITE_FILE_NAME>

For example:

npx jest .\test\healthNews.test.js

/\ Please refer to the "PatchNotes_VersionControl" file for /
/\ recent updates and changes made through each version. /\

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 32