-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds: * Procfile + web.sh to run the web server * Aptfiles with python as a dependency to serve static files * http-server module to serve the generated json files * Used the $TOOl_DATA_DIR in build.js to generate the files in the right path. * Added info in the readme Signed-off-by: David Caro <me@dcaro.es>
- Loading branch information
1 parent
59a591f
commit 0a9ba9e
Showing
6 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# used to serve the static files | ||
python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
web: scripts/web.sh | ||
update: scripts/update.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
DEST_DIR="$TOOL_DATA_DIR/public_html/data" | ||
|
||
echo "Updating" | ||
|
||
mkdir -p "$DEST_DIR" | ||
wget -O "$DEST_DIR/all.json" 'https://meta.wikimedia.org/w/api.php?action=sitematrix&uselang=en&format=json' | ||
|
||
# For the first run in case there's nothing there | ||
cp --update data/*.json "$DEST_DIR/" | ||
node scripts/build.js | ||
echo "Update finished" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
python -m http.server \ | ||
--bind "0.0.0.0" \ | ||
--directory "$TOOL_DATA_DIR/public_html/data" \ | ||
"$PORT" |