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