deployed link: https://social-media-api-l3uq.onrender.com
- Clone the repository: git clone https://github.com/VishalKNigam/Social-media-api
- Install dependencies: npm install
- Set up environment variables:
Create a
.env
file in the root directory and add the following variables: PORT=8080 MONGO_URL=your_database_url secretKey=your_secret_key refreshSecretKey=your_refrshsecret_key
- Start the server: npm run start
- Access the API endpoints: Base URL: http://localhost:8080
- Available endpoints:
/user/register
(POST): Register a new user./user/login
(POST): Login with username and password./post/create
(POST): Create a new post./post/
(GET): Retrieve all posts./relation/follow
(POST): To Follow./relation/unfollow
(POST): To Unfollow.
POST /user/register { "username": "user", "email": "user@.com", "password": "password" }
POST /user/login { "email": "user@.com", "password": "password" }
Thank You!!