By Tanatorn Nateesanprasert
This application contains 2 main components
- Golang application container (100% test on services layer)
- MongoDB container
P.S. MongoDB container have 3 replicas for doing operation in transaction
- run docker command on terminal:
docker compose up
- application runs on port
8080
- swagger url:
http://localhost:8080/swagger/index.html
- call register api and login to get token then authorize with value
Bearer {token}
Screen.Recording.2566-06-18.at.00.48.23.mov
- call other apis
user related
- register:
[POST] /api/v1/user/register
- login:
[GET] /api/v1/user/login
- (required login) update user:
[PUT] /api/v1/user
blog related
- (required login) create blog:
[POST] /api/v1/blog
- (required login) list blog:
[GET] /api/v1/blog?page={page}&limit={limit}
- (required login) get blog by id:
[GET] /api/v1/blog/:blogId
- (required login) update blog status:
[PUT] /api/v1/blog/:blogId
- (required login) archive blog:
[DELETE] /api/v1/blog/:blogId
comment related
- (required login) create comment:
[POST] /api/v1/comment/:blogId
- (required login) list comment:
[GET] /api/v1/comment/:blogId