Skip to content

adriansanchez88/NodeJS-API-Rest-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Rest base

This is the repository used during the development of the 'API Rest base'.

Table of Contents

DESCRIPTION

'API Rest base' is a base api to start new projects.

Back To The Top

DEVELOPMENT

All files in this repository were developed using Node.js v14.15.5, and the following dependencies are needed to run the project:

- dotenv (v8.2.0): A zero-dependency module that loads environment variables from a .env file into process.env. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology.
- express (v4.17.1): Used to provide server-side logic for web and mobile applications.
- morgan (v1.10.0): HTTP request logger middleware for node.js.
- swagger-ui-express: (v4.1.6): This module allows you to serve auto-generated swagger-ui generated API docs from express, based on a swagger.json file.
- winston: (v3.3.3): Designed to be a simple and universal logging library with support for multiple transports.

Back To The Top

HOW TO USE

It brings as an example the User model with two fields (id and name).

It consists of the following services:

  • getAllUsers: Get a list of all existing users. (GET/users/)
  • createUser: Create a new user. (POST/users/)
  • updateUser: Update an existing user by providing the id. (PUT/users/{id})
  • deleteUser: Delete an existing user by providing the id. (DELETE/users/{id})

Check documentation of the API to see how it works.

Back To The Top

AUTHOR INFO

Back To The Top

About

This is a base api to start new projects.

Resources

Stars

Watchers

Forks

Packages

No packages published