From 30d582a9c4b71962a5284b476fb70e9f2480cca3 Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 12 Nov 2021 19:53:34 -0800 Subject: [PATCH] Re-add support for nice outfit image URLs We removed this earlier in 7205455ccb5c76395a8ccf5df5b29a4358a214ab, but now it's time to re-add it! --- next.config.js | 12 ++++++++++++ vercel.json | 8 -------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/next.config.js b/next.config.js index 252c3e3..e924d60 100644 --- a/next.config.js +++ b/next.config.js @@ -2,6 +2,18 @@ module.exports = { env: { PUBLIC_URL: "", }, + async rewrites() { + return [ + { + source: "/outfits/:id/:size(150|300|600).png", + destination: "/api/outfitImage?size=:size&id=:id", + }, + { + source: "/outfits/:id/v/:updatedAt/:size(150|300|600).png", + destination: "/api/outfitImage?size=:size&id=:id&updatedAt=:updatedAt", + }, + ]; + }, async redirects() { return [ { diff --git a/vercel.json b/vercel.json index 2631ebd..969803f 100644 --- a/vercel.json +++ b/vercel.json @@ -1,13 +1,5 @@ { "routes": [ - { - "src": "/outfits/(?[^/]+)/(?150|300|600)\\.png", - "dest": "/api/outfitImage.js?size=$size&id=$id" - }, - { - "src": "/outfits/(?[^/]+)/v/(?[^/]+)/(?150|300|600)\\.png", - "dest": "/api/outfitImage.js?size=$size&id=$id&updatedAt=$updatedAt" - }, { "handle": "filesystem" },