diff --git a/index.js b/index.js index 729f80c..68d19f1 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,7 @@ var app = express() var PORT = process.env.PORT || 8080 var directory = process.env.FILES_DIR +var pubDir = path.join(directory, 'public') function humanFileSize(bytes, si = false, dp = 1) { const thresh = si ? 1000 : 1024; @@ -38,6 +39,7 @@ if (!directory) { const videoFormats = ["mp4", "mkv"] app.use(express.static(directory)) +app.use(express.static(pubDir)) app.listen(PORT, () => { console.log("Now listening on PORT: " + PORT) @@ -93,7 +95,7 @@ app.get("/video/*", (req, res) => { app.get("/*", (req, res) => { var file = req.params[0] - var absPath = path.join(directory, file) + var absPath = path.join(pubDir, file) if (file != '') { var baseHTML = fs.readFileSync(path.join(__dirname, 'resources/base.html')).toString()