fix API routing: remove /api prefix in Express routes

Uberspace web backend removes /api prefix before forwarding to Express,
so routes must not include /api. Changed from app.all('/api/*') to
app.all('/*').

/health route is defined first, so it takes precedence.

Fixes 404 errors when calling Steam API from production.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-02-06 21:50:51 +01:00
parent c2f819bdf9
commit 6a6fe467e1

View File

@@ -19,9 +19,10 @@ app.get("/health", (req, res) => {
res.json({ status: "ok" });
});
// Proxy for Steam API - exactly like the worker
app.all("/api/*", async (req, res) => {
const path = req.url.replace("/api", "");
// Proxy for Steam API
// Note: Uberspace removes /api prefix, so we get /<path> here
app.all("/*", async (req, res) => {
const path = req.url;
const steamUrl = `https://store.steampowered.com${path}`;
console.log(`Proxying: ${req.method} ${steamUrl}`);