#wasm #cloudflare #workers #worker #http

wasm-service

Simplify implementation of serverless WASM on Cloudflare Workers

11 releases

0.5.1 Feb 16, 2021
0.5.0 Feb 16, 2021
0.3.1 Dec 31, 2020
0.2.7 Dec 6, 2020

#304 in WebAssembly

24 downloads per month
Used in wasm-service-oauth

MIT/Apache

42KB
765 lines

Lightweight library for building Rust-WASM services on Cloudflare Workers.

The goal of this library is to make it easy to build fast and lightweight HTTP-based services in WASM, hosted on Cloudflare Workers. To keep things fast and lightweight, there is a strong preference for significant new capabilities to added as compile-time features or separate libraries.

Features

  • Fully async
  • Request & response bodies can be text, json, or binary
  • Non-blocking structured logging
  • Deferred tasks that run after response is returned to client

Add-ons

  • CORS handling and OAuth2

Getting started

To start a new project,

wrangler generate -t rust PROJECT \
    https://github.com/stevelr/rustwasm-service-template

where PROJECT is your project name.

rustwasm-service-template contains some relevant sample code, as well as instructions for setting up of Cloudflare and (optionally) Coralogix logging service.

Updates (v0.3)

  • Changes to support add-ons. See CHANGELOG for recent changes including breaking api changes to Handler.handle and Runnable.run functions.

Dependencies

~10–20MB
~427K SLoC

KC,`