Update README and add example env

This commit is contained in:
Ayooluwa Isaiah
2020-11-18 11:16:04 +01:00
parent 4266513640
commit 843a1394d8
2 changed files with 6 additions and 5 deletions

2
.env.example Normal file
View File

@@ -0,0 +1,2 @@
PORT=3000
NEWS_API_KEY=

View File

@@ -10,14 +10,13 @@ The code in this repo is meant to be a reference point for anyone following alon
## Prerequisites ## Prerequisites
- You need to have Go installed on your computer. The version used for the tutorial is **1.12.9**. - You need to have Go installed on your computer. The version used for the tutorial is **1.15.3**.
- Sign up for a [News API account](https://newsapi.org/register) and get your free API key. - Sign up for a [News API account](https://newsapi.org/register) and get your free API key.
## Get started ## Get started
- Clone this repository to your filesystem. - Clone this repository to your filesystem.
- Rename the `.env.example` file to `.env` and enter your News API Key.
- `cd` into it and run the following command: `go run main.go -apikey=<your news api key>` to start the server on port 3000. - `cd` into it and run the following command: `go build && ./news-demo` to start the server on port 3000.
- Visit http://localhost:3000 in your browser.
- View http://localhost:3000 in your browser.