/scala-worker-hello-world

Scala hello world for Cloudflare Workers

Primary LanguageScalaApache License 2.0Apache-2.0

Scala hello world for Cloudflare Workers

Your Scala code in Main.scala, running on Cloudflare Workers

In addition to Wrangler you will need to install the Scala build tool sbt, including a JDK.

Wrangler

To generate using wrangler

wrangler generate projectname https://github.com/cloudflare/scala-worker-hello-world

Further documentation for Wrangler can be found here.

sbt

After installing sbt per the linked instructions above,

cd projectname
sbt fullOptJS

That will compile your code and package it into index.js, after which you can run wrangler publish to push it to Cloudflare.

If you just want to check for errors during development without taking the time to package, running sbt ~compile will watch for filesystem changes and recompile. For more information, see the sbt docs

For more information on how Scala translates to Javascript, see the Scala.js docs.