Create a server where you just need a config file, and the program do the rest
- server name
- api port
- routes (name and HTTP method + describe which part of CRUD it is)
- data models (name, fields and fields type)
By default, the API is just a basic API with a logger to get the activity on the software
Default available routes:
- /health -> GET # display information about start time of the api, number of api calls and data models
- /health/html -> GET # display above information in html syntax
- /health/traffic -> GET # show all api calls
- /health/traffic/html -> GET # display above information in html syntax
If you're on Unix-like system, you can use the Makefile to run the Docker in background
If you can't use the Makefile, you can run:
docker-compose -f ./config/docker/docker-compose.yml up --build -d
If you can't use Docker, you can run:
go run .
For now the API only handle MongoDB, you can create a cluster and pass an url looking like that:
mongodb+srv://username:password@cluster0.k1vyunp.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0
This is the tutorial I followed to get the url https://www.mongodb.com/docs/drivers/go/current/quick-start/