diff --git a/.env.development b/.env.development index 273dfb3..9f76023 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,3 @@ PORT= CORS_ORIGIN= +BASE_PATH= \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 65cc345..ed81ed3 100755 --- a/src/index.ts +++ b/src/index.ts @@ -19,7 +19,7 @@ const port = app.use(express.static("public")); -app.get("/", (req, res) => { +app.get((process.env.BASE_PATH ? process.env.BASE_PATH : "/"), (req, res) => { res.send("Excalidraw collaboration server is up :)"); }); @@ -38,6 +38,7 @@ try { credentials: true, }, allowEIO3: true, + ...(process.env.BASE_PATH ? {path: process.env.BASE_PATH + "/socket.io/"} : {}), }); io.on("connection", (socket) => {