-
Local Host http://localhost:8080
-
Deployed Host https://beta-blog-be.herokuapp.com/
- https://github.com/ksemenza/beta-blog-fe
- Local http://localhost:3000
- Deployed Host https://beta-blog-fe.vercel.app
URL | ENDPOINT | DESCRIPTION |
---|---|---|
POST | /auth/register | register user |
POST | /auth/login | login user |
PUT | /auth/:id | Update user information |
DELETE | auth/ | delete user account |
GET | auth/1 | Get user by id |
GET | auth/1/details | Get user's posts |
NOTE: Username and Email must be unique and will not be created if they already exist
Register
{
"first_name": "First Name",
"last_name": "Last Name",
"username": "username",
"email": "email@email.com",
"password": "password-goes-here"
}
Login
{
"username": "username",
"password": "password-goes-here"
}
Update User
{ "id":"User ID",
"first_name": "First Name",
"last_name": "Last Name",
"username": "username",
"email": "email@email.com",
"password": "password-goes-here",
"id":"user id"
}
URL | ENDPOINT | DESCRIPTION |
---|---|---|
GET | /post | Gets all posts |
POST | /post | Add new post |
GET | /post/:id | Gets post by id |
PUT | /post/:id | Update post by id |
GET | /post/:id/details | Get post's comments |
NOTE: Space for Notes
Add Post
{
"author":"{USERNAME}",
"title":"Blog Title",
"content":"Blog Article",
"topic":"Tagged Topic",
"user_id":"{USER_ID}"
}
Update Post
{ "id":"Post ID",
"title":"Blog Title",
"content":"Blog Article",
"topic":"Tagged Topic",
"user_id":"1"
}
URL | ENDPOINT | DESCRIPTION |
---|---|---|
GET | /comment | Gets all comment |
POST | /comment | Add new comment |
GET | /comment/:id | Gets commentby id |
PUT | /comment/:id | Update comment by id |
GET | /comment/:id/details | Get comment notifications |
NOTE: Space for notes
Add Comment
{
"comment":"Comment on Post",
"post_id":"{POST_ID}"
}
Update Comment
{
"author":"{USERNAME}",
"id":"Comment ID",
"comment":"Comment on Post",
"post_id":"{POST_ID}"
}