diff --git a/api/outfitPageSSR.js b/api/outfitPageSSR.js index 2f626f1..69e5d9e 100644 --- a/api/outfitPageSSR.js +++ b/api/outfitPageSSR.js @@ -76,12 +76,14 @@ async function handle(req, res) { const updatedAtTimestamp = Math.floor( new Date(outfit.updatedAt).getTime() / 1000 ); - const outfitUrl = `https://impress-2020.openneo.net/outfits/${encodeURIComponent( - outfit.id - )}`; - const imageUrl = `https://impress-2020.openneo.net/api/outfitImage?size=600&id=${encodeURIComponent( - outfit.id - )}&updatedAt=${updatedAtTimestamp}`; + const outfitUrl = + `https://impress-2020.openneo.net/outfits` + + `/${encodeURIComponent(outfit.id)}`; + const imageUrl = + `https://impress-2020.openneo.net/outfits` + + `/${encodeURIComponent(outfit.id)}` + + `/v/${encodeURIComponent(updatedAtTimestamp)}` + + `/600.png`; const metaTags = ` diff --git a/vercel.json b/vercel.json index 1858cf7..9e1bff0 100644 --- a/vercel.json +++ b/vercel.json @@ -1,7 +1,11 @@ { "routes": [ + { + "src": "/outfits/(?[^/]+)/v/(?[^/]+)/(?150|300|600).png", + "dest": "/api/outfitImage.js?size=$size&id=$id&updatedAt=$updatedAt" + }, { "src": "/outfits/new(\\?|$)", "dest": "/index.html" }, - { "src": "/outfits/(?[^/]*)", "dest": "/api/outfitPageSSR.js?id=$id" }, + { "src": "/outfits/(?[^/]+)", "dest": "/api/outfitPageSSR.js?id=$id" }, { "handle": "filesystem" },