This repo contains all the src files for CRUD API created using Node JS , Express JS framework, Mongo DB, Mongoose ODM library.
This is a CRUD (Create, Read, Update, Delete) API project built with Node.js and Express.js. It provides endpoints for managing resources through HTTP requests.
Before getting started, ensure that you have the following installed:
- Node.js (version X.X.X)
- npm (Node Package Manager, usually comes with Node.js installation)
-
Clone this repository:
git clone https://github.com/your-username/crud-api-project.git
-
cd crud-api-project
-
npm install
To start the server and run the API, use the following command:
The API provides the following endpoints for managing resources:
- GET /api/resources: Retrieve all resources
- GET /api/resources/:id: Retrieve a specific resource by ID
- POST /api/resources: Create a new resource
- PUT /api/resources/:id: Update a specific resource by ID
- DELETE /api/resources/:id: Delete a specific resource by ID
You can use tools like Postman or cURL to send HTTP requests to these endpoints and interact with the API.
The API can be configured by modifying the .env file in the project root directory. Available configuration options include:
PORT: The port number on which the server should listen (default: 3000) DB_URI: The URI of the database connection Make sure to create a .env file and provide the necessary values for these configuration options.
Contributions are welcome! If you find any issues or want to contribute new features, feel free to open a pull request.
This project is licensed under the MIT License.
Feel free to customize this template according to your specific project requirements. Remember to replace placeholders such as `your-username` and update the content accordingly.