Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit c703718

Browse files
authored
Change server so that the script's not cached (#15)
1 parent c65f723 commit c703718

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
elm-stuff
22
dist
3-
*.tgz
3+
*.tgz
4+
*~

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ a webserver.
77

88
tar xzvf context-collapse-prebuilt.tgz
99
cd context-collapse
10-
python -m SimpleHTTPServer 8070
10+
python3 server.py
1111

12-
Then go to http://localhost:8070/ in your browser.
12+
Then go to http://localhost:8020/ in your browser.
1313

1414
You can edit your game by modifying the file `script.camp`
1515
in the `context-collapse` directory; the game will automatically
@@ -36,6 +36,7 @@ script to download all its dependencies and compile successfully.
3636
After doing the build process above, go into the parent directory and run
3737
a `tar` command to collect the necessary files.
3838

39+
rm -f context-collapse-prebuilt.tgz
3940
cd ..
4041
tar czvf context-collapse/context-collapse-prebuilt.tgz -T context-collapse/manifest.txt
4142

manifest.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
context-collapse/assets/avocomm-logo.png
22
context-collapse/dist/avocomm.js
33
context-collapse/index.html
4-
context-collapse/README.md
4+
context-collapse/run.sh
55
context-collapse/script.camp
6+
context-collapse/README.md

server.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import http.server
2+
PORT = 8020
3+
4+
class Handler(http.server.SimpleHTTPRequestHandler):
5+
def end_headers(self):
6+
self.send_header("Cache-Control", "no-cache, must-revalidate, max-age=0")
7+
http.server.SimpleHTTPRequestHandler.end_headers(self)
8+
9+
print("serving app at http://localhost:" + str(PORT) + "/")
10+
http.server.HTTPServer(('', PORT), Handler).serve_forever()
11+

0 commit comments

Comments
 (0)