- clone the respository
$ git clone https://github.com/Binary-Brigades/portfolio-cms.git $ cd portfolio-cms $ touch .env
- Add the following variables to the .env file
PORT = [port your that your will run on] mongoDbUrl = [mongodburl] mongoDbName = [name of the database] AccessTokenSecretKey = [random string ] AccessTokenExpires = 0 CLOUDINARY_CLOUD_NAME= CLOUDINARY_API_KEY= CLOUDINARY_API_SECRET= CLOUDINARY_URL=
request
- url: https://portfolio-cms-nine.vercel.app/api/v1/auth/login
- method: POST
- request body:
"email": "string" "password": "string"
response
- status code:
200
if success else401
- response body:
"status": "success",
"access_token": "<user access token >",
request
- url: https://portfolio-cms-nine.vercel.app/api/v1/user/profile
- method: GET
response
- status code:
200
- example of a response body:
"username": "maich",
"email": "mainamaich@gmail.com",
request
- url: https://portfolio-cms-nine.vercel.app/api/v1/user/edit-profile
- method: POST
- request body:
username: string optional email: string optional password: string optional confirm_password: ref(password)
response
- status code:
200
- response body:
"first_name": "maich",
"last_name": "magode",
"email": "mainamaich@gmail.com",
request
- url: https://portfolio-cms-nine.vercel.app/api/v1/project/getall
- method: GET
- request headers(token):
authorization:`Bearer token`
response
- status code:
200
- response body:
[
{
"title": "",
"description": "",
"createdBy": "",
"duration": "",
"githublink": "",
"livelink": "",
"time": "",
"tabs": [],
"imageUrls": []
}
]
request
- url: https://portfolio-cms-nine.vercel.app/api/v1/project/:id
- method: GET
response
- status code:
200
- response body:
{
"title": "",
"description": "",
"createdBy": "",
"duration": "",
"githublink": "",
"livelink": "",
"time": "",
"tabs": [],
"imageUrls": []
}
request
- url: https://portfolio-cms-nine.vercel.app/api/v1/project
- method: POST
- request headers(token):
authorization:`Bearer token`
- request body:
{
"title": "",
"description": "",
"createdBy": "",
"duration": "",
"githublink": "",
"livelink": "",
"time": "",
"tabs": [],
"imageUrls": []
}
response
- status code:
201
- message :"project created successfully"
- response body:
{
"title": "",
"description": "",
"createdBy": "",
"duration": "",
"githublink": "",
"livelink": "",
"time": "",
"tabs": [],
"imageUrls": []
}
request
- url: https://portfolio-cms-nine.vercel.app/api/v1/project/:id
- method: PUT
- request headers(token):
authorization:`Bearer token`
- request body:
{
"title": "",
"description": "",
"createdBy": "",
"duration": "",
"githublink": "",
"livelink": "",
"time": "",
"tabs": [],
"imageUrls": []
}
response
- status code:
200
- message :"Project updated successfully"
- response body:
{
"title": "",
"description": "",
"createdBy": "",
"duration": "",
"githublink": "",
"livelink": "",
"time": "",
"tabs": [],
"imageUrls": []
}
request
- url: https://portfolio-cms-nine.vercel.app/api/v1/project/:id
- method: DELETE
- request headers(token):
authorization:`Bearer token`
response
- status code:
200
- message :"Project deleted successfully"
- response body: