Giter Site home page Giter Site logo

chechavalerii / node-express-fast-progress Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 18 KB

This generator will help you to build your own Node.js Express API

License: Other

JavaScript 100.00%
node starter generator api api-rest restful-api rest yeoman javascript js mongoose mongodb

node-express-fast-progress's Introduction

Node.js REST API with Express Mongoose

CircleCI branch npm Plugin on redmine.org onix

Node.js Express API with vanilla JS. Supports MongoDB(mongoose)

See node-express-typescript-api if you need TypeScript

Description

This generator will help you to build your own Node.js REST API with Express Mongoose.

Project Introduction

Requirements

  • node >= 12
  • npm >= 6
  • mongodb >= 4.0

Installation

First, install Yeoman and generator-node-express-fast-progress using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g generator-node-express-fast-progress

Then generate your new project:

yo node-express-fast-progress

App skeleton

.
├── LICENSE
├── README.MD
├── nodemon.json
├── package-lock.json
├── package.json
└── src
    ├── components
    │   ├── User
    │   │   ├── index.js
    │   │   ├── model.js
    │   │   ├── router.js
    │   │   ├── service.js
    │   │   └── validation.js
    │   └── validation.js
    ├── config
    │   ├── connection.js
    │   ├── middleware.js
    │   └── router.js
    ├── error
    │   └── ValidationError.js
    └── server
        ├── events.js
        ├── index.js
        └── server.js

Running the API

Development

To start the application in development mode, run:

npm install -g nodemon
npm install

Start the application in dev env:

nodemon

Start the application in production env:

Install forever PM2:

npm install -g pm2

example start with scale on 2 core:

pm2 start ./src/index.js -i 2 --no-daemon

Express server listening on http://localhost:3000/, in development mode The developer mode will watch your changes and re-run the node application automatically.

Find User

   curl --location --request GET 'localhost:3000/v1/users'

Create User

   curl --location --request POST 'localhost:3000/v1/users' \
   --header 'Content-Type: application/json' \
   --data-raw '{
      "email": "[email protected]",
      "fullName": "Wow Yay"
   }'

Update User

   curl --location --request PUT 'localhost:3000/v1/users' \
   --header 'Content-Type: application/json' \
   --data-raw '{
      "id": "5e50265429fbb59255fb8428",
      "fullName": "Yay Foo"
   }'

Delete User

   curl --location --request DELETE 'localhost:3000/v1/users' \
   --header 'Content-Type: application/json' \
   --data-raw '{
      "id": "5e502541bb617386c48f6a8c"
   }'

Getting To Know Yeoman

  • Yeoman has a heart of gold.
  • Yeoman is a person with feelings and opinions, but is very easy to work with.
  • Yeoman can be too opinionated at times but is easily convinced not to be.
  • Feel free to learn more about Yeoman.

node-express-fast-progress's People

Contributors

nodeteamdev avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

node-express-fast-progress's Issues

Sergey docker

create docker-compose file with two services

  1. mongodb
  2. redis

create dockerfile + make file

Yuriy

create component teachers

Toha

create component department

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.