Effect CommunityEC
Effect Community8mo ago
13 replies
Kishore

Using MyApiLive Layer with Cloudflare Workers for Direct Request Handling

I have defined my MyApiLive.
export const MyApiLive = HttpApiBuilder.api(EffectApi).pipe(
  Layer.provide(EffectApiLive),
);


I am using cloudflare worker, which takes request and returns a response. How can I run this layer without creating a server? Rather pass request and return Response directly from cloudflare?

import { MyApiLive } from './effect';

export default {
  async fetch(request) {
     // ??? How can run MyApiLive layer by passing request and return response?
    return new Response(JSON.stringify(result, null, 2));
  },
};
Was this page helpful?