https://finalproject-be-production.up.railway.app
/auth/register
{
"name": "john doe",
"email": "john@gmail.com",
"password": "john",
"confPassword": "john"
}
menambahkan user baru dengan role
user
dan profile imgdefault.jpg
/auth/login
{
"email": "admin@gmail.com",
"password": "admin"
}
login dengan email dan password yang telah di daftar mengembalikan mengembalikan token jwt yang berisi id, name, email, role
/auth/me
{
"token": "<token>"
}
/auth/logout
fitur crud user harus rolenya admin
/user
/users/<userId>
/users
Bodyraw (json)
{
"name": "admin",
"email": "admin@gmail.com",
"password": "admin",
"role": "admin" // enum (user / admin)
}
/users/<userId>
{
"name": "dwi",
"email": "dwi@gmail.com",
"password": "dwi",
"role": "user" enum (user / admin)
}
- bisa salah satu yang di update
/users/<userId>
Body form-data
/users/updateprofilepicture
'Content-type': 'multipart/form-data' dengan key
file
BLOG
/blog
/blog/:id
/blog
body-raw (JSON)
{
"image" : "gambar2.jpg",
"title" : "ini judul2",
"subTitle" : "ini subTitle2",
"description" : "ini description2",
"createdBy" : "637df1bff73d4c3f5d47eaf8"
}
/blog/:id
body-raw (JSON)
{
"image" : "gambar2.jpg",
"title" : "ini judul2",
"subTitle" : "ini subTitle2",
"description" : "ini description2",
"createdBy" : "637df1bff73d4c3f5d47eaf8"
}
bisa edit salah satu
/blog/:id
BLOG COMMENT
/blog/:id/comment
body-raw (JSON)
{
"content" : "cek komen",
"postedBy" : "637df1bff73d4c3f5d47eaf8"
}
/blog/:id/comment
/blog/:id/comment/:idComment
VIDEO
/video
/video/:id
/video
body-raw (JSON)
{
"videoId": "ini adalah videoId",
"judul": "ini adalah judul",
"deskripsi": "ini adalah deskripsi"
}
/video/:id
body-raw (JSON)
{
"videoId": "masukkan id video yang akan diupdate",
"judul": "masukkan judul yang akan diupdate",
"deskripsi": "masukkan deskripsi yang akan diupdate"
}
karena menggunakan patch, data yang diedit bisa salah satu saja.
/video/:id
VIDEO COMMENT
/video/:id/comment
body-raw (JSON)
{
"commentContent": "ini adalah isi comment",
"postedBy": "ini adalah id user"
}
/video/:id/comment
/video/:id/comment/:idComment
/faq
/faq?limit=1&page=1
Dapat menyeting berapa jumlah data yang ingin ditampilkan
/faq?question=<question_value>
anda bisa memakai opsi di atas
/faq?limit=1&page=5&question=example
/faq
Body raw (json)
{
"question": "testing pertanyaan10",
"answer": "testing jawaban"
}
/faq/<faqId>
Body raw (json)
{
"question": "testing pertanyaan10",
"answer": "testing jawaban"
}
/faq/<faqId>