diff --git a/app.js b/app.js index 42b018b..045d56a 100644 --- a/app.js +++ b/app.js @@ -18,6 +18,7 @@ const launcherRoutes = require("./routes/launcher"); const buildingRoutes = require("./routes/buildings"); const app = express(); +app.set("trust proxy", 1); const PORT = process.env.PORT || 3000; /* ======================== @@ -104,8 +105,9 @@ app.get("/api/building/:id", async (req, res) => { [buildingId], ); + const buildingInfo = info[0] || {}; res.json({ - name: info[0].name, + name: buildingInfo.name || "Gebäude", level: building.level, points: building.points, nextLevelPoints: nextLevel[0]?.required_points || null,