Best HacktivOverFlow Ever
http://jack-overflow.jackbloo.com
npm install
For running
npm run dev
- Using CRON it will fetch 3 highest votes every 1 week on sunday at 00:00 Asia/Jakarta local time
- Watched Tags
- upvoting and downvoting
Complete Routing of this App
Includes SignIn and Regisitration
To Sign In without using google authorization
url: 'http://localhost:3000/user/signin'
headers: token *required*,
body: {
email:{
type: string
required: true
} ,
password:{
type: string
required: true
}
},
response status: {
success: {
status: 200,
token
}
}
To Register Account in Hacktivoverflow
url: 'http://localhost:3000/user/register'
headers: none,
body: {
name:{
type: string
required: true
} ,
email:{
type: string
required: true
},
password:{
type:string,
required:true
}
},
response status: {
success: {
status: 201
}
}
Includes, CRUD of questions
User creating questions
url: 'http://localhost:3000/questions/create'
headers: token *required*,
body: {
title:{
type: string
required: true
} ,
pertanyaan:{
type: string
required: true
},
tagku:[]
},
response status: {
success: {
data : {
title,
pertanyaan,
upvote,
downvote,
UserId,
tags
},
status: 201
}
}
User can update their questions
url: 'http://localhost:3000/question/update/:id'
headers: token *required*,
body: {
title: String,
pertanyaan: String,
tags: [String]
},
response status: {
success: {
data : {
title,
pertanyaan,
upvote,
downvote,
UserId,
tags
},
status: 201
}
}
Deleting User's questions
url: 'http://localhost:3000/question/:id'
headers: token *required*
body: none,
response status: {
success: {
data : {
title,
pertanyaan,
upvote,
downvote,
UserId,
tags
},
status: 200
}
}
Get All questions
url: 'http://localhost:3000/questions',
headers: token *required*,
body: none,
response status: {
success: {
data:{
title,
pertanyaan,
upvote,
downvote,
UserId,
tags
},
status: 200
}
}
Get One question
url: 'http://localhost:3000/question/mine/:id'
headers: token *required*,
body: none,
response status: {
success: {
data : {
title,
pertanyaan,
upvote,
downvote,
UserId,
tags
},
status: 200
}
}
Get User's question
url: 'http://localhost:3000/question/mine'
headers: token *required*,
body: none,
response status: {
success: {
data : {
title,
pertanyaan,
upvote,
downvote,
UserId,
tags
},
status: 200
}
}
Update User's upvote question
url: 'http://localhost:3000/question/upvote/:id'
headers: token *required*,
body: none,
response status: {
success: {
data : {
title,
pertanyaan,
upvote,
downvote,
UserId,
tags
},
status: 200
}
}
Update User's downvote question
url: 'http://localhost:3000/question/downvote/:id'
headers: token *required*,
body: none,
response status: {
success: {
data : {
title,
pertanyaan,
upvote,
downvote,
UserId,
tags
},
status: 200
}
}
Update User's question Tag
url: 'http://localhost:3000/question/createTags'
headers: token *required*,
body: none,
response status: {
success: {
data : {
title,
pertanyaan,
upvote,
downvote,
UserId,
tags
},
status: 200
}
}
Get Tags by Name
url: 'http://localhost:3000/question/tags/:tag'
headers: token *required*,
body: none,
response status: {
success: {
data : {
title,
pertanyaan,
upvote,
downvote,
UserId,
tags
},
status: 200
}
}
Include CRU of answer
User creating answers
url: 'http://localhost:3000/answer/create'
headers: token *required*,
body: {
title:{
type:String,
required: true
},
jawaban: {
type: String,
required: true
},
},
response status: {
success: {
data : {
title
jawaban
UserId
upvote
downvote
},
status: 201
}
}
User can update their answers
url: 'http://localhost:3000/answer/update/:id'
headers: token *required*,
body: {
title:{
type:String,
required: true
},
jawaban: {
type: String,
required: true
},
},
response status: {
success: {
data : {
title
jawaban
UserId
upvote
downvote
},
status: 201
}
}
Get All answer
url: 'http://localhost:3000/answer',
headers: token *required*,
body: none,
response status: {
success: {
data:{
title
jawaban
UserId
upvote
downvote
},
status: 200
}
}
Get One answer
url: 'http://localhost:3000/answer/mine/:id'
headers: token *required*,
body: none,
response status: {
success: {
data : {
title
jawaban
UserId
upvote
downvote
},
status: 200
}
}
Get User's question
url: 'http://localhost:3000/answer/mine'
headers: token *required*,
body: none,
response status: {
success: {
data : {
title
jawaban
UserId
upvote
downvote
},
status: 200
}
}
Include Login of Admin
Admin login
url: 'http://localhost:3000/answers/:id'
headers: token *required*,
body: {
username: {
type: String,
required: true
},
password: {
type: String,
required: true
},
},
response status: {
success: {
data : {
token
},
status: 201
}
}
#ERROR
Form of Error Handling
code: httpStatus || 406,
message,
Error caused by the Users ('Bad request')
code: 400,
'Email is already Registered',
Error due to the unauthorization
code: 401,
'Not Authorized',
Error caused by Token
code: 403,
'Token Undefined',
Error caused by Token
code: 404,
'Not Found',
Error cause by Internal Server Error
code: 500,
'Internal Server Error',