ahc-cabal new-install --installdir node/ --overwrite-policy=always all
cd node/
ahc-dist --input-exe hello-cloudflare-hs --export-function handleReq --no-main --input-mjs hello-cloudflare-hs.mjs --bundle --browser
# Publish
curl -X PUT "https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/workers/scripts/$SCRIPT_NAME" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-F "[email protected];type=application/json" \
-F "[email protected];type=application/javascript" \
-F "[email protected];type=application/wasm"
If you install wrangler
and cloudflared
and adapt wrangler.toml
then you can also do wrangler tail
to fetch logs from your function.