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

Commit e7a8a05

Browse files
authored
Merge pull request #1804 from nquinlan/master
create a serverless version, closes #1766, #1732, #1663
2 parents 8a288b3 + 6df84f9 commit e7a8a05

File tree

14 files changed

+491
-159
lines changed

14 files changed

+491
-159
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
PORT= # Port to be used by the app
21
GOOGLE_API_KEY= # Google Maps API KEY

.github/workflows/geocode.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: geocode-new-addresses
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
geocode:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions/setup-node@v1
12+
- run: npm install; npm run geocode
13+
env:
14+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
15+
- uses: stefanzweifel/git-auto-commit-action@v4
16+
with:
17+
commit_message: Geocoded newly added addresses
18+
commit_author: MLH Localhost <localhost@mlh.io>

README.md

Lines changed: 17 additions & 18 deletions
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+
```

0 commit comments

Comments
 (0)