Move dashboard, add static dir

This commit is contained in:
bingus_violet 2024-01-16 19:02:26 +00:00
parent a61b5aab79
commit b5edf2d6d4
3 changed files with 18 additions and 2 deletions

View file

@ -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("<p>404: not found!</p>")
res.send(baseStart + "<h2>404: not found!</h2>" + baseEnd)
return
}

View file

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard</title>
</head>
<body>
<h2>Upload</h2>
<form action="/upload" enctype="multipart/form-data">
<input type="text">
</form>
</body>
</html>