news-api-go-app

command module
v0.0.0-...-e3f1f61 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 11 Imported by: 0

README

News Demo go app

All credits to @freshman starter files

Tutorial: https://freshman.tech/web-development-with-go/

demo

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL