Giter VIP home page Giter VIP logo

giridharsaitinnaluri / simple-node-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 38 KB

This repository contains a simple Nodejs API that performs CRUD (Create, Read, Update, Delete) operations on a MongoDB database. The API is well commented and follows a scalable folder structure that separates the routes, controllers, models and utilities. ๐Ÿ˜Š

Home Page: https://ecommerce-api-omega-five.vercel.app

JavaScript 100.00%
crud environment-variables express js mongodb mongoose mvc-architecture nodejs rest-api error-handling

simple-node-api's Introduction

simple-node-api

This repository contains a simple Nodejs API that performs CRUD (Create, Read, Update, Delete) operations on a MongoDB database. The API is well commented and follows a scalable folder structure that separates the routes, controllers, models and utilities. ๐Ÿ˜Š

To run the API, you need to have Node.js and MongoDB(or Mongodb Atlas) installed on your machine. Then, clone this repository and run npm install to install the dependencies. Next, create a .env file in the root folder and add your MongoDB connection string as MONGO_URI and PORT. Finally, run npm start to start the server.

The API has four endpoints:

  • GET /products/: Returns a list of all products in the database. ๐Ÿ“ƒ
  • POST /products/create: Creates a new product with the given name and quantity in the body of the request. Returns the created product. ๐Ÿ†•
  • PUT /products/:id/update_quantity/?number=10: Updates the product with the given id with the name and quantity in the body of the request. Returns the updated product. ๐Ÿ”„
  • DELETE /products/:id: Deletes the product with the given id from the database. Returns a message confirming the deletion. โŒ

You can use tools like Postman or curl to test the API. ๐Ÿ˜Ž

Demo Link

firebase link -

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.