This repo contains News & Tag service and also apispec & http test.
- MongoDB
- Create database name "crud"
- Create collection "news & tags"
- Redis
Clone this repository :
git clone https://github.com/zidnim5/httprouter-crud-golang-mongoDB.git
Adjust database.go & redis.go in app folder
Execute command below :
go mod init golang-mongodb
go mod tidy
Simple way to run this service :
make dev
.
├── app # Configuration Files
├── controller # Controller Files
├── exception # Exception handling Files
├── helper # Helper Files
├── model # Model Files
| └── domain
| └── web
├── repository # Repository Files
├── service # Service Files
├── apispec.json # Service Files
├── docker-compose.yml
├── dockerfile
├── go.mod
├── go.sum
├── makefile
├── tags.http
├── news.http
└── readme.md
This service using "MongoDB & Redis" to stored News & Tags data.
To connected to this endpoint please ensure your base_url is "localhost:3000" or you can adjust your own port in main.go file
You can spesific test to available http test below :
- tags.http
- news.http