Skip to content
This repository was archived by the owner on Apr 20, 2022. It is now read-only.

Commit 16a639d

Browse files
committed
Bring docs inline with new code
1 parent 4124301 commit 16a639d

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

README.md

+17-18
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,24 @@ This repository contains the source code for a map of the hometowns of anyone wh
1414

1515
## Technologies used in this project
1616

17-
### NodeJS
17+
### [GitHub Actions](https://github.com/features/actions)
18+
GitHub actions allows us to run a [NodeJS script](#nodejs) automatically when a commit is pushed to the project. That script takes all the locations provided and turns them into latitude & longitude coordinates.
1819

19-
The map itself is a Node.js application. Node.js allows us to write full-stack
20+
### [GitHub Pages](https://pages.github.com/)
21+
GitHub pages lets us host our map on GitHub as a webpage.
2022

21-
## NPM packages used
23+
### [NodeJS](https://nodejs.org)
2224

23-
### [express](https://www.npmjs.com/package/express)
25+
We chose to use NodeJS as the language to turn all the hometown names into coordinates.
2426

25-
Fast, unopinionated, minimalist web framework for node. This is the framework with which we built the application.
26-
27-
### [dotenv](https://www.npmjs.com/package/dotenv)
27+
#### [dotenv](https://www.npmjs.com/package/dotenv)
2828

2929
Dotenv is a zero-dependency module that loads environment variables from a `.env` file into `process.env`. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology.
3030

31-
### [node-geocoder](https://www.npmjs.com/package/node-geocoder)
31+
#### [node-geocoder](https://www.npmjs.com/package/node-geocoder)
3232

3333
Node library for geocoding and reverse geocoding.
3434

35-
### [ejs](https://www.npmjs.com/package/ejs)
36-
37-
Embedded JavaScript templates
38-
3935
## Try the application locally, if you want!
4036

4137
### Google Maps API Key
@@ -56,8 +52,6 @@ Japan
5652

5753
To add a new location, simply append a new line to the locations.txt file
5854

59-
There is also a `locations.txt.example` file that can be used to test the app. Copy its content to locations.txt and restart the app.
60-
6155
## Running the application:
6256

6357
To run this application locally, you'll need to:
@@ -75,14 +69,19 @@ npm install
7569
There is a `.env.example` file that can be used to configure the app. Simply create a copy named `.env`
7670

7771
```txt
78-
PORT= # Port to be used by the app
7972
GOOGLE_API_KEY= # Google Maps API KEY
8073
```
8174

82-
Now inside the root folder run:
75+
Now inside the root folder run the following:
8376

8477
```
85-
npm start
78+
npm geocode
8679
```
8780

88-
Now you can access locally in your browser the address `http://localhost:3000` and see your locations map.
81+
This will turn each line in the `locations.txt` into a set of coordinates.
82+
83+
You can see your own map by running:
84+
85+
```
86+
npm start
87+
```

geocode.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
require("dotenv").config();
22
const path = require("path");
3-
const util = require("util");
43

54
const Storage = require("./src/storage");
65
const Locations = require("./src/locations");

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"doc": "docs"
88
},
99
"scripts": {
10+
"start": "npx static-server",
1011
"geocode": "node geocode.js"
1112
},
1213
"engines": {
@@ -28,5 +29,8 @@
2829
"express": "^4.16.4",
2930
"morgan": "^1.9.1",
3031
"node-geocoder": "^3.22.0"
32+
},
33+
"devDependencies": {
34+
"static-server": "^2.2.1"
3135
}
3236
}

0 commit comments

Comments
 (0)