prism-cli 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/prism +1 -1
- data/wasm-server.js +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4e7a243f950f778fcad1038af5d129e2ff685e2172bfc26424ce1f16d29f4ffa
|
|
4
|
+
data.tar.gz: bf138cc012d2c8d6c05db2879663fbd5849c95bfeacb1c1af59bcdacdac5bebd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4746c18c3c6d1f20c9374e867da7ec921fcdec51484032f6dc1c3c191a3e9a281feb54f85cc8866264c58e74908b4219c0ca3c9f4dd12e20c6c76bbcf5a57f8e
|
|
7
|
+
data.tar.gz: ec5a76c3d1a00f1e92b967de992c6bf4f2c0c81a580dd91050e11e041d8b55fef64b09a259364a4bfb2660ae986d4aa5ac576c08a6bfbf545714bde811ea8b11
|
data/bin/prism
CHANGED
|
@@ -80,7 +80,7 @@ def build(files)
|
|
|
80
80
|
`
|
|
81
81
|
|
|
82
82
|
`cp #{__dir__}/../dist/prism.js ./prism.js`
|
|
83
|
-
File.write("./index.html", HTML_TEMPLATE)
|
|
83
|
+
File.write("./index.html", HTML_TEMPLATE) unless File.exists?("./index.html")
|
|
84
84
|
`rm bundle.c bundle.rb main.c`
|
|
85
85
|
puts "Compiled to build/"
|
|
86
86
|
end
|
data/wasm-server.js
CHANGED
|
@@ -3,8 +3,11 @@ const fs = require('fs');
|
|
|
3
3
|
const path = require('path');
|
|
4
4
|
|
|
5
5
|
const proxy = http.createServer((req, res) => {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
let p = path.join('.', req.url);
|
|
7
|
+
|
|
8
|
+
if (req.url === '/') {
|
|
9
|
+
p = path.join('.', 'index.html');
|
|
10
|
+
}
|
|
8
11
|
|
|
9
12
|
try {
|
|
10
13
|
if (p.endsWith('.wasm')) {
|
|
@@ -20,4 +23,5 @@ const proxy = http.createServer((req, res) => {
|
|
|
20
23
|
res.end();
|
|
21
24
|
});
|
|
22
25
|
|
|
23
|
-
proxy.listen(
|
|
26
|
+
proxy.listen(3042, '127.0.0.1');
|
|
27
|
+
console.log("Listening on localhost:3042");
|