```ts export default <ExportedHandler<Env>> { ...
# workers-discussions
u
Copy code
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) {
        ...
    }
};