- Clone this repository
https://github.com/ROFL1ST/todo-mongo-api.git
- run "npm install"
- Create .env file, then copy this code below
DB_HOST = [mongodb_host] <--- insert your mongodb
JWT_ACCESS_TOKEN = [jwt_token]
JWT_INVITATION_TOKEN = [jwt_invitation_token]
DB_DATABASE = todo
process.env.PORT = 8000
CLOUD_NAME = [cloud_name]
API_KEY_CLOUD = [cloud_key]
API_SECRET_CLOUD = [secret_cloud]
MAIL_HOST = [host_mail]
MAIL_PORT = [port]
MAIL_USERNAME = [mail_username]
MAIL_PASSWORD = [mail_password]
MAIL_CLIENT_URL = [url]
EMAIL_MAIL= [your_email]
EMAIL_PASSWORD = [your_password]
- run "npm start"
LOCAL URL = http://localhost:9000/api/
ONLINE URL = https://todo-mongo-api-production.up.railway.app/api/
/login
Method : POST Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
Body
Name | Status | |
---|---|---|
Required | String | |
username | Required | String |
password | Required | String |
/register
Method : POST Headers
Name | Status | |
---|---|---|
Authorization | Optional | String |
Body
Name | Status | |
---|---|---|
Required | String | |
username | Required | String |
password | Required | String |
name | Required | String |
/user
Method : PUT Headers
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
Body
Name | Status | |
---|---|---|
username | Optional | String |
name | Optional | String |
photo_profile | Optional | File |
/user
Method : GET
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
Params
Name | Status |
---|---|
username | Optional |
name | Optional |
/user/[id]
Method : GET
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
/profile
Method: GET
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
/todo
Method: Get
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
Params
Name | Status |
---|---|
page | Optional |
limit | Optional |
key | Optional |
/todo/[id]
Method: Get
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
/todo
Method: Post
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
Body
Name | Status | |
---|---|---|
name | Required | String |
description | Required | String |
/todo/[id]
Method: Put
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
Body
Name | Status | |
---|---|---|
name | Optional | String |
description | Optional | String |
percent | Optional | String |
/todo/[id]
Method: Delete
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
/todo/add/[id]
Method: Post
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
Body
Name | Status | |
---|---|---|
invitedUser | Required | String |
/todo/invitation
Method: Get
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
/todo/invitation
Method: Put
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
Body
Name | Status | |
---|---|---|
status | Required | ["accepted", "rejected"] |
/todo/kick/[id]
Method: Delete
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
/todo/role/[id]
Method: Put
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
Body
Name | Status | |
---|---|---|
role | Required | String |
/todo/list/[id]
Method: Get
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
/todo/detail-list/[id]
Method: Get
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
/todo/createList
Method: Post
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
Body
Name | Status | |
---|---|---|
id_todo | Required | String |
name | Required | String |
start | Required | Date |
end | Required | Date |
/todo/list/[id]
Method: Put
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |
Body
Name | Status | |
---|---|---|
name | Optional | String |
start | Optional | Date |
end | Optional | Date |
priority | Optional | ["low", "normal", "high", "urgent"] |
status | Optional | ["open", "pending", "in progress", "completed"] |
/todo/remove-list/[id]
Method: Delete
Headers
Name | Status | |
---|---|---|
Authorization | Required | String |