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" },