https://discord.cloudflare.com logo
Title
u

柴柴

05/25/2023, 6:33 AM
ts
export default <ExportedHandler<Env>> {
    async fetch(req, env, ctx) {
        ...
    },

    async tail(events, env) {
        for (const event of events) {
            if (!(event.event as TraceItemFetchEventInfo).request) continue;
            await env.BUCKET.put(
                '',
                JSON.stringify(event),
                { httpMetadata: { contentType: 'application/json' } }
            );
        }
    },

    async scheduled(event, env, ctx) {
        ...
    }
};