From b5edf2d6d40c9bf759e94bf1d0b328b99410841c Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Tue, 16 Jan 2024 19:02:26 +0000 Subject: [PATCH] Move dashboard, add static dir --- index.js | 5 +++-- resources/dashboard.html | 0 static/dashboard/index.html | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) delete mode 100644 resources/dashboard.html create mode 100644 static/dashboard/index.html diff --git a/index.js b/index.js index 8e54695..41a3465 100644 --- a/index.js +++ b/index.js @@ -19,6 +19,7 @@ if (!directory) { } app.use('/b', express.static(directory)) +app.use(express.static(path.join(__dirname, 'static'))) app.listen(PORT, () => { console.log("Now listening on PORT: " + PORT) @@ -35,11 +36,11 @@ app.get("/b*", (req, res) => { var absPath = path.join(directory, file) res.setHeader('Content-Type', 'text/html') - + try { var dirContents = fs.readdirSync(absPath) } catch (error) { - res.send("

404: not found!

") + res.send(baseStart + "

404: not found!

" + baseEnd) return } diff --git a/resources/dashboard.html b/resources/dashboard.html deleted file mode 100644 index e69de29..0000000 diff --git a/static/dashboard/index.html b/static/dashboard/index.html new file mode 100644 index 0000000..4847893 --- /dev/null +++ b/static/dashboard/index.html @@ -0,0 +1,15 @@ + + + + + + + Dashboard + + +

Upload

+
+ +
+ + \ No newline at end of file