3.5.0 • Published 1 year ago

express-mongodb-crud-template v3.5.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Express.js MongoDB CRUD Template

This project is an Express.js template for building
a backend server that performs CRUD (Create, Read, Update, Delete)
operations using a MongoDB database.

Installation

šŸ’» npm i express-mongodb-crud-template
šŸ’» npm i express mongodb cors body-parser nodemon
šŸ–± # run this command to setup 
šŸ–± # then follow the steps are there is server.js file
šŸ–± # then run the npm start 
šŸ“ƒ # package.json file "start": "nodemon server.js",
šŸ’» npm start

šŸ”‘ Key Features:

āš™ļø Database Connection:

šŸ”© Establishes a secure connection to a MongoDB Atlas database using the provided MongoDB URI.

Express.js Server:
Sets up an Express.js server to handle HTTP requests on specified routes.
CORS Middleware:
Implements CORS middleware to enable cross-origin requests and facilitate communication with frontend applications.
CRUD Operations:
Defines routes for basic CRUD operations on a hypothetical "users" collection in the MongoDB database.
Endpoints:
GET /: Returns a welcome message indicating that the backend is operational.
GET /users: A placeholder endpoint for fetching a list of users.
POST /user: A placeholder endpoint for creating a new user.
GET /users/:id: A placeholder endpoint for fetching details of a specific user by ID.
DELETE /users/:id: A placeholder endpoint for deleting a user by ID.
Error Handling:
Basic error handling is incorporated to catch and log any errors during database connection and server operation.
Usage:

šŸ“‹ Note : Ensure that a MongoDB Atlas account is set up, and replace the uri variable with your own MongoDB URI.

3.4.0

1 year ago

3.5.0

1 year ago

3.3.0

1 year ago

3.2.0

1 year ago

3.1.0

1 year ago

1.2.0

1 year ago

1.1.9

1 year ago

1.9.0

1 year ago

1.1.8

1 year ago

1.8.0

1 year ago

1.1.7

1 year ago

1.7.0

1 year ago

1.1.6

1 year ago

1.6.0

1 year ago

1.5.0

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

2.3.0

1 year ago

2.2.0

1 year ago

2.5.0

1 year ago

2.4.0

1 year ago

2.7.0

1 year ago

2.6.0

1 year ago

2.9.0

1 year ago

2.8.0

1 year ago

2.1.0

1 year ago

2.0.0

1 year ago

3.0.0

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago