1.0.7 • Published 2 years ago

rest-api-init v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

rest-api-init

Fastest way to create REST API with Node.js, Express.js & MongoDB.

Prerequisites

  • Node.js needs to be installed.
  • MongoDB Compass needs to be installed only if you are running this api as it is. If you are using the MongoDB cloud database then just change the DATABASE_URI in index.js.

Installation

  • Run npx rest-api-init.
  • When prompted to install rest-api-init package, enter y
  • On completion, open terminal inside the root directory and run npm start
  • Open localhost:5000 on your browser to view the text Your server is ready!

Features

Configuration

  • index.js initializes the REST API
    • PORT defines the port in which the server will run. The URL will look like this localhost:<PORT>
    • DATABASE_URI is configured for local database by default which needs MongoDB Compass to be installed.
  • routes/routes.js will contain the routes e.g. get/post/patch/put/delete
  • models/model.js will have the Schema defined for the database

Preferably define PORT and DATABASE_URI in a .env file.

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago