From 93fe5f22600cb557bb1866bcc4bcd84c539ce321 Mon Sep 17 00:00:00 2001 From: ztimson Date: Sun, 27 Oct 2024 08:25:06 -0400 Subject: [PATCH] Organized --- package.json | 2 +- apollo.js => src/apollo.js | 0 cli.js => src/cli.js | 0 controller.js => src/controller.js | 0 http.js => src/http.js | 2 +- index.js => src/main.js | 0 misc.js => src/misc.js | 0 sensor-suite.js => src/sensor-suite.js | 0 serial.js => src/serial.js | 0 index.html => ui/index.html | 0 10 files changed, 2 insertions(+), 2 deletions(-) rename apollo.js => src/apollo.js (100%) rename cli.js => src/cli.js (100%) rename controller.js => src/controller.js (100%) rename http.js => src/http.js (86%) rename index.js => src/main.js (100%) rename misc.js => src/misc.js (100%) rename sensor-suite.js => src/sensor-suite.js (100%) rename serial.js => src/serial.js (100%) rename index.html => ui/index.html (100%) diff --git a/package.json b/package.json index d5a2e9b..a8f5f15 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "type": "module", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "start": "node src/main.js" }, "author": "", "license": "MIT", diff --git a/apollo.js b/src/apollo.js similarity index 100% rename from apollo.js rename to src/apollo.js diff --git a/cli.js b/src/cli.js similarity index 100% rename from cli.js rename to src/cli.js diff --git a/controller.js b/src/controller.js similarity index 100% rename from controller.js rename to src/controller.js diff --git a/http.js b/src/http.js similarity index 86% rename from http.js rename to src/http.js index d9767a8..840cbc6 100644 --- a/http.js +++ b/src/http.js @@ -12,7 +12,7 @@ export default class Http extends Controller { this.express.get('*', (req, res) => { let p = req.params['0']; if(!p || p == '/') p = 'index.html'; - const absolute = path.join(import.meta.url, '/../', p).replace('file:', ''); + const absolute = path.join(import.meta.url, '/../../ui/', p).replace('file:', ''); res.sendFile(absolute); }); this.express.get('/api/*', async (req, res) => { diff --git a/index.js b/src/main.js similarity index 100% rename from index.js rename to src/main.js diff --git a/misc.js b/src/misc.js similarity index 100% rename from misc.js rename to src/misc.js diff --git a/sensor-suite.js b/src/sensor-suite.js similarity index 100% rename from sensor-suite.js rename to src/sensor-suite.js diff --git a/serial.js b/src/serial.js similarity index 100% rename from serial.js rename to src/serial.js diff --git a/index.html b/ui/index.html similarity index 100% rename from index.html rename to ui/index.html