This project is a blogging system developed using TypeScript, Express, and Mongoose. It features user authentication, blog creation, and comment posting functionalities.
- Installation
- Usage
- API Documentation
- Node.js
- MongoDB
- Clone the repository
- Install Dependencies
- Create a '.env' file in the root directory and add the following
- Build the project
- Start server
git clone https://github.com/Darkeh1807/IBlog.git
cd IBlog
npm install
PORT = PORT NUMBER
MONGOURL = your_mongodb_connection_string
JWTSECRET = your_jwt_secret
npm run build
npm run start
npm run dev
npm run build
npm start
- URL: '/api/users/register'
- Method: 'POST'
- Request Body { "name": "John Doe", "email": "johndoe@example.com", "password": "yourpassword", "role": "ADMIN" }
NB: If no role is specified, Defaults to 'USER'
- URL: '/api/users/login'
- Method: 'POST'
- Request Body { "email": "johndoe@example.com", "password": "yourpassword" }
- URL: '/api/users/blog'
- Method: 'POST'
- Request Body { "title": "Example blog title", "description": "Example blog content ", "createdBy": "admin ID", }