kalio007 / Task2-Endpoint

HNGX Backend Task2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CRUD API with Express.js, Mongoose, and MongoDB

This CRUD API was built using Express.js and Mongoose, utilizing a MongoDB database for managing a list of items. It also includes CORS support and uses dotenv for managing environmental variables.

This project can be found on https://hng-task2-g7uj.onrender.com/api/

Prerequisites

Before you get started, make sure you have the following installed on your system:

Installation

  1. Clone the repository to your local machine:
    git clone https://github.com/kalio007/Task2-Endpoint
  1. Navigate to the project directory:
    cd hng-task2
  1. Install the project dependencies:
npm install

Configuration

  1. Create and modify an .env file in the project root to store your environmental variables. Example:
PORT=3000
MONGODB_URI= <your mongodb uri>
  • PORT: The port on which the API will run.
  • MONGODB_URL: The URL for your MongoDB database.

Running the API

To start the API, run the following command:

npm start

The API should now be running on the specified port (default is 3000).

API Endpoints, Use Cases, and Error Handling

See documentation.

https://github.com/kalio007/Task2-Endpoint/blob/main/docs/DOCUMENTATION.md

Conclusion

You've now successfully set up and run the CRUD API. You can use the provided API endpoints to create, read, update, and delete items in your MongoDB database.

This README.md file provides a clear and structured guide on how to set up, run, and use the CRUD API created with Express.js, Mongoose, and MongoDB. It includes key topics like endpoints, configuration, error management, and additional details.

About

HNGX Backend Task2


Languages

Language:JavaScript 100.0%