cf_workers

Creator: coderz1093

Last updated:

0 purchases

cf_workers Image
cf_workers Images

Languages

Categories

Add to Cart

Description:

cf workers

Cloudflare Workers.dart #
Usage #
import 'package:http/http.dart';
import 'package:cf_workers/cf_workers.dart';

Future<void> main() {
return Workers((JSRequest request) async {
return Response("Hello, World!", 200).toJS;
}).serve();
}
copied to clipboard
dart compile wasm bin/api.dart -p __dart/api.wasm
copied to clipboard
import { instantiate, invoke } from "./__dart/api.mjs";
import dartModule from "./__dart/api.wasm";
import { exec } from "./web/exec.mjs";

export default {
async fetch(request, _env, _ctx) {
const dartInstance = await instantiate(dartModule);
return exec(() => invoke(dartInstance), request);
},
};
copied to clipboard
npx wrangler dev
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.