refactor: clean up code formatting and improve readability in timetable endpoint

This commit is contained in:
2026-02-27 23:08:44 +01:00
parent 2a75de4d8a
commit e82b209994

View File

@@ -18,7 +18,7 @@ app.get('/timetable', async (req, res) => {
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}`)