News Demo go app
All credits to @freshman starter files
Tutorial:
https://freshman.tech/web-development-with-go/
What was changed:
X-Api-Key
in request header instead of query
- input maxlength as per API specs
- Dockerfile.dev for air live reload
- Dockerfile for deploying to fly.io
TODO - refactor noodles into several files
Prerequisites
You need to have Go installed on your computer. Or you may use docker and docker compose for dev purpose
Get started
- Clone or download this repository to your filesystem.
$ git clone https://github.com/samvimes01/news-api-go-app
$ cd news-api-go-app
$ docker compose up
- Deploy is possible to fly.io. It automativally detects Dockerfile. Without it assets aren't deployed and app fails
$ fly auth login
$ flyctl launch // No for deploy since there are env secrets
$ fly secrets set NEWS_API_KEY=blah // het your key at newsapi.org; secrets are available ar runtime as env vars
$ flyctl deploy