fix: Use images

This commit is contained in:
Wanjohi
2025-06-13 13:57:43 +03:00
parent 88f499ba5e
commit 9827100d19
8 changed files with 109 additions and 5 deletions

22
infra/cdn.ts Normal file
View File

@@ -0,0 +1,22 @@
import { domain } from "./dns";
import { storage } from "./storage";
export const cdn = new sst.aws.Router("CDNRouter", {
routes: {
"/public": {
bucket: storage,
rewrite: {
regex: "^/public/([a-zA-Z0-9_-]+)$",
to: "/images/$1"
},
},
},
domain: {
name: "cdn." + domain,
dns: sst.cloudflare.dns()
}
});
export const outputs = {
cdn: cdn.url
}