Skip to content

xplatformed/super-food

Repository files navigation

Super Food API  README-3a5f8be5.jpg

This superfood api performs CRUD (Create, Read, Update and Delete) operations. A superfood is a healthy food source that provides health benefits. This api can be used to discover interesting facts about super food products.

Getting Started

The following instructions will get the project up and running on your local machine for development and testing purposes.

Prerequisites

You must have Node.js and MongoDB installed on your machine. You can click the below links, if you don’t have them already installed.

Install Node.js

Install MongoDB

This app runs off of a MongoDB Database. Whether you have Mongo running locally or in production.

Installing

First run the install command to fetch all the dependency packages listed in the project's package.json file.

  • npm install

  • Then run the application

  • npm run start

Please make sure you have MongoDB server running either locally or in production.

Populating Database

To add superfood data to the running mongoDB database run the following command:

npm run populate

After you have run the above command you will see the superfood data displayed in your terminal/console window.

Once data has been added to the MongoDB database run following command:

npm run start

to re-run the server.

Making API Requests

You can make the following requests:

(GET)   /superfoods

(GET)   /superfoods/:id

Testing

Install Postman

Postman API tutorial for beginners

In postman you can create and test the following routes:

(POST)   /superfoods/create

(DELETE)   /superfoods/:id

(PATCH)   /superfoods/:id

Running test script

To run tests run following command:

npm run tests

Documentation

All documentation for methods and functions can be found in:

docs

Please note: open the docs .html files in browser

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published