This Golang application consumes a JSON payload from https://www.data.gov/, populates a database and displays the database contents on a web page.
Frameworks used:
- Echo to build the website: https://github.com/labstack/echo
- Resty to retrieve data from Data.gov: https://github.com/go-resty/resty
- Jsonparser to process the data: https://github.com/buger/jsonparser
- GORM to populate the database: https://github.com/jinzhu/gorm
Create a .env
file with the following variables:
POSTGRES_USER=user
POSTGRES_PASSWORD=admin
POSTGRES_DB=renewable_energy
DB_PORT=5432
DB_HOST=db
The app is setup with Docker. Run it with docker-compose
:
docker-compose up;
The app will be available in http://localhost:8080/renewables