Skip to content

Scala example of Workers KV

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

isabella232/scala-worker-kv

 
 

Scala example of using Cloudflare Workers KV

Main.scala is an example of using Cloudflare Workers KV from Scala.

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-kv

When editing wrangler.toml to include your account_id, you will also need to add your kv namespace id to the binding under kv-namespaces.

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.

About

Scala example of Workers KV

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 100.0%