aboutsummaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
authorJakob Stendahl <jakob.stendahl@outlook.com>2019-09-22 13:12:44 +0200
committerJakob Stendahl <jakob.stendahl@outlook.com>2019-09-22 13:12:44 +0200
commite6880cd8ccf82d993f222cb14b4860581654acb8 (patch)
tree45f318f4ece2f0d6ca73fc3f775b9ba277ccdb77 /app.js
parente911f8029ca612d3b17ced300cdf5b6f13e20972 (diff)
parent2e60b25ae368b8c19ce5e982aa2672a6c56edf90 (diff)
downloadLuxcena-Neo-e6880cd8ccf82d993f222cb14b4860581654acb8.tar.gz
Luxcena-Neo-e6880cd8ccf82d993f222cb14b4860581654acb8.zip
Merge branch 'master' of https://github.com/JakobST1n/Luxcena-Neo
Diffstat (limited to 'app.js')
-rw-r--r--app.js22
1 files changed, 15 insertions, 7 deletions
diff --git a/app.js b/app.js
index a023546..a4d9651 100644
--- a/app.js
+++ b/app.js
@@ -7,7 +7,7 @@ let io = require("socket.io").listen(server);
// Firstly we set up all globals, check that the usrData dir exists, if not, we run the setup
let srcDir = __dirname;
-let installDir = "/home/pi/luxcena-neo-install/"
+let installDir = "/home/lux-neo/"
if (process.argv.length >= 3) { installDir = process.argv[2]; }
let dataDir = installDir + "/userdata/";
if (!fse.existsSync(dataDir)) { throw new Error("APPDIR not found! Exiting..."); }
@@ -55,16 +55,22 @@ fse.ensureDirSync(dataDir + "/usrCode/");
fse.ensureDirSync(dataDir + "/remoteCode/");
// Generate config-files
if (!fse.existsSync(dataDir + "/config/versionChecker.json")) {
- fse.writeJsonSync(dataDir + "/config/versionChecker.json", {
+ fse.writeFileSync(dataDir + "/config/versionChecker.json", JSON.stringify({
"branch": "dev",
"checkInterval": 5
- })
+ }, null, 4));
}
if (!fse.existsSync(dataDir + "/config/strip.json")) {
- fse.writeJsonSync(dataDir + "/config/strip.json", {
- "segments": [9, 8, 8, 8, 8, 8, 4],
- "segmentConfiguration": "snake"
- })
+ fse.writeFileSync(dataDir + "/config/strip.json", JSON.stringify({
+ "segments": [],
+ "matrix": [],
+ "segmentConfiguration": "snake",
+ "led_pin": 18,
+ "led_freq_hz": 800000,
+ "led_dma": 10,
+ "led_invert": false,
+ "led_channel": 0
+ }, null, 4));
}
@@ -74,6 +80,8 @@ let neoRuntime = require("./src/neoRuntime")(dataDir);
// Setup static assets
app.use(express.static("public/assets"));
+// Serve docs
+app.use("/docs", express.static("docs/_book/"));
// Gave up using webpack to compile monaco, therefore, loading the already-compiled code. Probably the slowest way possible, but so it goes.
app.use("/monaco-editor", express.static("node_modules/monaco-editor/"));
// Setup all our custom middleware