diff --git a/index.js b/index.js index ab04f12..8e54695 100644 --- a/index.js +++ b/index.js @@ -18,15 +18,24 @@ if (!directory) { return } -app.use(express.static(directory)) +app.use('/b', express.static(directory)) app.listen(PORT, () => { console.log("Now listening on PORT: " + PORT) + + if (!passwd) { + console.log("Password variable not found. Uploading from site is not available.") + } else { + console.log("Password variable found! Uploads are now available on the site.") + } }) -app.get("/*", (req, res) => { +app.get("/b*", (req, res) => { var file = req.params[0] var absPath = path.join(directory, file) + + res.setHeader('Content-Type', 'text/html') + try { var dirContents = fs.readdirSync(absPath) } catch (error) { @@ -46,4 +55,8 @@ app.get("/*", (req, res) => { res.write(baseEnd) res.end() +}) + +app.get("/", (req, res) => { + res.redirect("/b") }) \ No newline at end of file diff --git a/resources/dashboard.html b/resources/dashboard.html new file mode 100644 index 0000000..e69de29