-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Air Pollution Service 🌱 | ||
A simple Go service that provides a RESTful API for retrieving emission and air pollution data for | ||
all countries over the last 300 years. This microservice serves as a backend service that handles requests to | ||
fetch historical environmental data, including CO₂ emissions, air pollutants, and other | ||
environmental factors, for every country around the globe. | ||
|
||
The required raw data can be downloaded here https://www.kaggle.com/datasets/rejeph/air-pollution. | ||
|
||
## 🚀 Endpoints | ||
|
||
## How to run | ||
| Name | HTTP Method | Route | | ||
|---------------------------------------------------|-------------|---------------------------| | ||
| List all countries | GET | /countries | | ||
| Returns a single country | GET | /countries/{name} | | ||
| List all emissions of all countries for each year | GET | /emissions/year | | ||
| List all emissions of all years for each country | GET | /emissions/country | | ||
| List all emissions of a specific country | GET | /emissions/country/{name} | | ||
|
||
### Locally | ||
* Copy the raw data to a file, e.g. `/data/air-pollution.csv`. | ||
* Point env variable `AIR_POLLUTION_FILE` to the file path. | ||
* Run the service: | ||
```bash | ||
go build cmd/server/main.go | ||
go go run cmd/server/main.go | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters