This is the explaination for the authentication using jwt token.
Before setting up the project, ensure you have the following dependencies installed:
-
Clone the repository:
git clone https://github.com/yash-levi1896/kalviumassignment.git
-
Navigate to the project directory:
cd E-commerce-API
-
Install dependencies:
npm install
-
Create a .env file in the project root and configure your environment variables:
PORT = any port number MongoURL=your-mongodb-connection-uri Secret_key=your-secret-key
-
Start the server:
npm run server
- POST /user/register: Register a new user.
- POST /user/login: Authenticate and log in a user.
- GET /category/getcategory: Retrieve a list of all categories.
- POST /category/addcategory: Create a new category.