From 486be88731350442d69841590a6a4a6a24018f06 Mon Sep 17 00:00:00 2001 From: raphael Date: Wed, 19 May 2021 13:46:05 +0200 Subject: [PATCH] change expose static folder order --- scripts/server-backend.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/server-backend.js b/scripts/server-backend.js index deb6316..3b63d58 100644 --- a/scripts/server-backend.js +++ b/scripts/server-backend.js @@ -19,8 +19,7 @@ function startBackendServer(port) { var s_whiteboard = require("./s_whiteboard.js"); var app = express(); - app.use(express.static(path.join(__dirname, "..", "dist"))); - app.use("/uploads", express.static(path.join(__dirname, "..", "public", "uploads"))); + var server = require("http").Server(app); server.listen(port); var io = require("socket.io")(server, { path: "/ws-api" }); @@ -30,6 +29,10 @@ function startBackendServer(port) { const { accessToken, enableWebdav } = config.backend; + //Expose static folders + app.use(express.static(path.join(__dirname, "..", "dist"))); + app.use("/uploads", express.static(path.join(__dirname, "..", "public", "uploads"))); + /** * @api {get} /api/loadwhiteboard Get Whiteboard Data * @apiDescription This returns all the Available Data ever drawn to this Whiteboard