Skip to content

Basic API example that is built with Node.js and Express in javascript. Database connection with Mongoose (ODM) and supports authentication and authorization with JWT.

Notifications You must be signed in to change notification settings

Talpiot-HiTech/Node-Express-REST-API-JS-Example

Repository files navigation

Node.js Express REST API JS Example

This API example is a basic backend application to test basic API functions.

Table of Contents
  1. About The Application
  2. How To Install
  3. Available Scripts
  4. Postman

About The Application

This API is a basic example of a REST API backend application.

It is built with Node.js and Express Framework with Javascript. In addition, the applications database is MongoDB, with the use of an ODM, Mongoose. Additionally, the application has basic authentication and authorization functionality with the use of JWT.

In the applicaiton we can add books to the database and users can signip, login, edit, and delete their account. In addition, each user has their own cart where they can store books they want to buy, and checkout if they wish too.

The point of this backend application is to test basic API functions.

(back to top)

Built With

(back to top)

How To Install

Git clone

git clone https://github.com/Talpiot-HiTech/Node-Express-REST-API-Example.git

Instructions

  • After cloning the the repository run npm i in order to install all the dependencies.
  • Fill in all the values of the env variables in config/dev.env file so that the application will run properly during development mode.

(back to top)

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the production mode.
However, this script is only meant to be run when deploying the application. The application is built, where you need to setup the env variables on the machine that you will be hosting it on or on a web hosting service, unlike in development mode.

npm run dev

Runs the app in the development mode.
Open localhost on the port you decided on in the env variables to view it in the browser.

The API will reload if you make edits with the use of nodemon.

(back to top)

Postman

Above, there is a link that will take you to the postman files in my postman profile where you can test the API functionality in the browser.

However if you would like to run the files locally on your machine in the postman desktop application, included in the repository, in the postman directory all the files so you can import them. In addition, you will have to configure env variables in postman so that the API testing will work properly everything.

(back to top)

About

Basic API example that is built with Node.js and Express in javascript. Database connection with Mongoose (ODM) and supports authentication and authorization with JWT.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published