diff --git a/server/server.js b/server/server.js index f20e86967cd243fe7646cbe30a34403f89e9fb22..5d13b33d50b013fff52295644f8f559d99c69b22 100644 --- a/server/server.js +++ b/server/server.js @@ -174,6 +174,22 @@ app.post( } ); +try { + const autoAttachRoomsPath = path.join(__dirname, "autoAttach.json"); + const urlList = JSON.parse(fs.readFileSync(autoAttachRoomsPath)); + const attach = async function (roomUrl) { + try { + const room = await attachToRoom(roomUrl); + attachedRooms[room.uid] = room; + } catch (error) {} + }; + for (const url of urlList) { + attach(url); + } +} catch (error) { + console.error("Could not read autoAttachroomList:", error); +} + try { console.debug("[Debug] Running in", process.cwd()); console.debug("[Debug] Running as", __filename);