Follow these steps to set up and run the API on your local machine:
git clone <repository-url>Create a .env file in the project root and set the following environment variables:
PORT=5000
MongoURI=mongodb://localhost:27017/your-database-namePORT: The port on which the API will run (default is 5000).MongoURI: The MongoDB connection URI (use your local MongoDB or a cloud-hosted instance).
Install the project dependencies by running:
npm installStart the API server:
npm startThe API should now be running locally at http://localhost:5000.
The API provides the following endpoints for managing user data:
- Endpoint:
POST /api
- Endpoint:
GET /api/:id
- Endpoint:
GET /api?name=Sam
- Endpoint:
PUT /api/:id
- Endpoint:
DELETE /api/:id
Contributions are welcome! If you have suggestions, improvements, or bug fixes, please open an issue or create a pull request.