diff --git a/index.js b/index.js index 4576b7b..4c667c6 100644 --- a/index.js +++ b/index.js @@ -15,10 +15,10 @@ app.get('/timetable', async (req, res) => { try { await untis.login(); // Start und Ende der aktuellen Woche bestimmen - + const now = luxon.DateTime.local(); const startOfWeek = now.startOf('week').toJSDate(); // Montag - const endOfWeek = now.endOf('week').plus({ days: 7*4*4 }).toJSDate(); // Sonntag + const endOfWeek = now.endOf('week').plus({ days: 7 * 4 * 4 }).toJSDate(); // Sonntag // Stundenplan für diese Woche abrufen const timetable = await untis.getOwnTimetableForRange(startOfWeek, endOfWeek); @@ -32,7 +32,21 @@ app.get('/timetable', async (req, res) => { } }) -console.log(process.env) +const os = require('os'); +const nets = os.networkInterfaces(); +const results = {}; + +for (const name of Object.keys(nets)) { + for (const net of nets[name]) { + if (!net.internal) { + results[name] = results[name] || []; + results[name].push(net.address); + } + } +} + +console.log('Local IPs:', results); + app.listen(port, () => { console.log(`Example app listening on port ${port}`)