Skip to content

acoyfellow/zero-cloudflare-hello

Repository files navigation

Zero on Cloudflare

check License: MIT

Deploy to Cloudflare

A Zero native executable, running in a Cloudflare Container, exposed by a tiny Worker.

curl https://zero.coey.dev
# hello from Zero on Cloudflare infra

The program behind that response:

pub fun main(world: World) -> Void raises {
    check world.out.write("hello from Zero on Cloudflare infra\n")
}

How it works

request → Worker → Container → Zero ELF → stdout response

Zero emits a Linux executable. Cloudflare Containers run Linux executables. The Worker forwards HTTP to a small container adapter, which runs the Zero binary and returns stdout.

Repo map

Path Purpose
hello.0 Zero source.
artifacts/hello-linux-musl-x64 261-byte deployable ELF.
src/index.ts Worker → Container routing.
server.mjs Container HTTP adapter.
Dockerfile Container image.
wrangler.jsonc Cloudflare deployment config.

Deploy

Click the button above. It forks this repo and deploys the Worker + Container. First-time Containers can take a few minutes to become ready.

The tiny ELF is committed so one-click deploy does not need to install the experimental Zero compiler.

Rebuild the Zero binary

curl -fsSL https://zerolang.ai/install.sh | bash
export PATH="$HOME/.zero/bin:$PATH"
npm run build:zero

Scope

This demonstrates Zero native output on Cloudflare Containers. Zero does not yet expose a production native HTTP server runtime, so the container includes a visible HTTP adapter.

About

Run a Zero native executable on Cloudflare Containers. One-click deployable hello world.

Topics

Resources

License

Stars

7 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors