Update README and add example env
This commit is contained in:
2
.env.example
Normal file
2
.env.example
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
PORT=3000
|
||||||
|
NEWS_API_KEY=
|
@@ -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.
|
|
||||||
|
Reference in New Issue
Block a user