#cloudflare-workers #worker #cloudflare #http #request-response

no-std 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

#776 in WebAssembly

27 downloads per month
Used in wasm-service-oauth

MIT/Apache

44KB
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

~11–31MB
~551K SLoC