mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 16:55:37 +02:00
fix: Use images
This commit is contained in:
22
infra/cdn.ts
Normal file
22
infra/cdn.ts
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user