This will create a REST API using Express JS and MongoDB removing the hassle of creating everything from scratch.

Overview

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.

You might also like...

A rest api which scrapes data from asianembed or asianload. Made using NodeJS, Express and Cheerio.

A rest api which scrapes data from asianembed or asianload. Made using NodeJS, Express and Cheerio.

Dec 6, 2022

Simple REST API using Express with TypeScript, PostgreSQL, and MySQL to practice the Clean Architecture by Uncle Bob.

Clean-Architecture Simple REST API using Express with TypeScript, PostgreSQL, and MySQL to practice the Clean Architecture by Uncle Bob. About This RE

Oct 16, 2022

A simple, no-hassle library for efficiently querying Your Enrollment Services.

@vanderbilt/yes-api A simple, no-hassle library for efficiently querying Your Enrollment Services. Created by Dylan Hanson (jovialis) NOTE: THIS MODUL

Jan 25, 2022

The aim is to provide a hassle-free way to use the data to build applications to show close-to-realtime power-outage info in Mauritius

The aim is to provide a hassle-free way to use the data to build applications to show close-to-realtime power-outage info in Mauritius

Mauritius Dataset for Electricity Dataset View Dataset The aim is to provide a hassle-free way to use the data to build applications. Example applicat

Dec 15, 2022

An open-source analytics library to measure user events the hassle-free way.

An open-source analytics library to measure user events the hassle-free way.

walker.js The walker.js is an open-source event tracker for all tools. Easy, standardized & flexible. Capture user events in the browser by setting HT

Dec 22, 2022

Examples and challenges of my video about Creating and testing a complete Node.js Rest API (Without frameworks)

Building a complete Node.js WebApi + testing with no frameworks Welcome, this repo is part of my youtube video about Creating and testing a complete N

Dec 23, 2022

An interactive app that allows adding, editing and removing tasks of a to-do list. Drag-and-drop featured added. Webpack was used to bundle all the Js modules in to one main Js file.

An interactive app that allows adding, editing and removing tasks of a to-do list. Drag-and-drop featured added. Webpack was used to bundle all the Js modules in to one main Js file.

To-do List A to-do list app This app let you to set your own to-do list. Built With HTML CSS JavaScript WebPack Jest Live Page Page Link Getting Start

May 5, 2022

An online library for adding and removing a different number of books from a user collection, keeping track of the books you've read and the one's you are yet to read

An online library for adding and removing a different number of books from a user collection, keeping track of the books you've read and the one's you are yet to read

Awesmoe Books A Website demo for our project of book store, The website has ability of adding and removing you books from yor library, Thats reflects

Jul 8, 2022

this project is an online library application that enables users to keep track of books in their library by adding to and removing books from a list. Built with JavaScript ES6 syntax, HTML, and CSS

Awesome-Book1 The aim of this project is to restructure the Awesome books app code by using ES6 syntax and organising the workspace using modules. The

Jul 17, 2022
Owner
Souvik Das
Souvik Das
This is the FARM Stack course, where you are going to learn how to build an application from scratch using FASTAPI, React and mongoDB

FARM-Stack-Course This is the FARM Stack course, where you are going to learn how to build an application from scratch using FASTAPI, React and mongoD

Bek Brace 121 Jan 2, 2023
This is a boilerplate for creating your own languages for various use cases. You can even create your own programming language from scratch!

Bootstrap compiler This is a bootstrap compiler that can be used to compile to compiler written in the target language. You can write a compiler in th

Kaan 3 Nov 14, 2022
An easy way to create a TypeScript library without hassle.

ts-lib-template An easy way to create a TypeScript library without hassle. ts-lib-template is a template for creating a TypeScript library. It comes b

Snehil K 7 Sep 13, 2022
In this project, I built a simple HTML list of To-Do tasks. This simple web page was built using Webpack, creating everything from a JavaScript index file that imported all the modules and assets

To Do List In this project, I built a simple HTML list of To-Do tasks. This simple web page was built using Webpack, creating everything from a JavaSc

Andrés Felipe Arroyave Naranjo 10 Mar 31, 2022
A base API template for a REST API using express.

express-api-template A base API template for a REST API using express. Philosophy Setting up a new project can be a long and tedious process, especial

T3NED 6 May 29, 2022
This project is about the awesome books we did during Microverse to build a website for adding and removing the books.Done using HTML and ES6 JAVASCRIPT and modules

Awesome-books-with-ES6 Description the project. this project is about the awesome books we did during Microverse to build a website for adding and rem

Ilham Bouaik 5 May 28, 2022
⚙️ REST api with NodeJS(KoaJS) MongoDB and Jest Tests.

RESTRIS Functional Backend implementation of REST api with NodeJS(KoaJS) MongoDB and Jest Tests. Tools TypeScript Node KoaJS MongoDB Mongoose Jest Sup

Beatriz Oliveira 8 Dec 2, 2022
REST API built with Node.js, MongoDB, Mongoose & TypeScript. I also dabbled with Docker and Caddy for deployments

REST API with Node.js, Mongoose & TypeScript Note: This repository includes the postman collection for the finished API Note 2: Make sure you add .env

Manuchimso Oliver 2 Sep 16, 2022
Set up and build a Node.js REST API using Typescript, Express, Mongoose with a maintainable and scalable structure.

Introduction Create a maintainable and scalable Node.js REST API with TypeScript, Express and Mongoose. The project structure is based on MVC and foll

Adam Khomsi 16 Nov 18, 2022
A template containing everything you need for creating your own Obsidian theme.

This is a sample theme for Obsidian (https://obsidian.md). First Time publishing a theme? Quick start First, choose Use this template. That will creat

Obsidian.md 15 Dec 28, 2022