Skip to content

Commit b728780

Browse files
committed
chore: 新增圖片資源並更新 wrangler 設定以包含資產目錄
1 parent 6386250 commit b728780

5 files changed

Lines changed: 16 additions & 1 deletion

File tree

public/image/original.png

435 KB
Loading

public/image/preview.png

5.33 KB
Loading

src/eventRouter.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ export async function eventRouter(event: any, channelAccessToken: string, ctx: E
5858
},
5959
];
6060
}
61+
case "image": {
62+
return [
63+
{
64+
type: "image",
65+
originalContentUrl: "https://lwt.ccepr.dev/image/original.png",
66+
previewImageUrl: "https://lwt.ccepr.dev/image/preview.png",
67+
},
68+
];
69+
}
6170
default: {
6271
return [
6372
{

worker-configuration.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/* eslint-disable */
2-
// Generated by Wrangler by running `wrangler types` (hash: 887cd4de063cd900845a9d5fd302267c)
2+
// Generated by Wrangler by running `wrangler types` (hash: d0e3937095cad28325a958a570d1d1c6)
33
// Runtime types generated with workerd@1.20260526.1 2026-01-28 nodejs_compat
44
interface __BaseEnv_Env {
55
CF_VERSION_METADATA: WorkerVersionMetadata;
6+
ASSETS: Fetcher;
67
timezone: "Asia/Taipei";
78
LINE_CHANNEL_SECRET: string;
89
LINE_CHANNEL_ACCESS_TOKEN: string;

wrangler.jsonc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"timezone": "Asia/Taipei",
1111
},
1212
"routes": [{ "custom_domain": true, "pattern": "lwt.ccepr.dev" }],
13+
"assets": {
14+
"directory": "./public/",
15+
"binding": "ASSETS",
16+
"run_worker_first": ["/", "!/image/*"],
17+
},
1318
"placement": {
1419
"mode": "smart",
1520
},

0 commit comments

Comments
 (0)