Skip to content

bashor/kotlin-worker-hello-world

 
 

Repository files navigation

Kotlin hello world for Cloudflare Workers

Your Kotlin code in main.kt, running on Cloudflare Workers

In addition to Wrangler v2.x you will need to install a JDK 8 or newer. The easiest way to do this is using the free Community Edition of IntelliJ IDEA.

Wrangler

Configure the wrangler.toml by filling in the account_id from the Workers pages of your Cloudflare Dashboard.

Further documentation for Wrangler can be found here.

Build & Deploy

After setting up your environment, run the following command:

./gradlew :compileProductionExecutableKotlinWasmJs

That will compile your code into a WebAssembly executable and JavaScript glue code, after which you can run wrangler deploy to push it to Cloudflare:

npx wrangler@latest deploy build/js/packages/kotlin-worker-hello-world-wasm-js/kotlin/kotlin-worker-hello-world.js

Learn more

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 52.4%
  • HTML 24.6%
  • JavaScript 23.0%