Welcome to the Newspaper Website Backend API! This API, developed using Node.js, Express.js, and MongoDB, provides functionality for managing articles, categories, and users.
Explore and interact with the API using the following Postman Collection Documentation links:
- Users Collection Documentation
- Categories Collection Documentation
- Articles Collection Documentation
To run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/eCodeVoyager/Newspaper_backend.git
-
Navigate to the project directory:
cd Newspaper_backend -
Install dependencies:
npm install
-
Create a
.envfile:Create a file named
.envin the project directory and define the following variables. Replace the placeholder values with your specific configurations.PORT=3000 MONGODB_URI=mongodb+srv://your-mongodb-uri ACCESS_TOKEN_SECRET=your-secret REFRESH_TOKEN_SECRET=your-secret ACCESS_TOKEN_LIFE=1d REFRESH_TOKEN_LIFE=100d
Note: An example
.envfile is provided in the project folder. -
Run the project:
npm start
The server will be running at
http://localhost:3000by default.
The API utilizes JWT (JSON Web Tokens) for user authentication. Customize the JWT configuration by editing the .env file.
Feel free to reach out for any questions or assistance. Happy coding!