Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 30 Jan 23:42
· 252 commits to main since this release
v0.3.0
3a069cb

This release brings in a couple of bugfixes and improvements

  • A new inbuilt router (based on itty-router) to provide easy routing in a single component. The new handleRequest method takes in the HttpRequest
import { HandleRequest, HttpRequest, HttpResponse } from "spin-sdk"

const encoder = new TextEncoder()

let router = utils.Router()

router.get("/", () => {return {status: 200, body: encoder.encode("default route").buffer}})
router.get("/home", () => {return {status: 200, body: encoder.encode("home route").buffer}})

export const handleRequest: HandleRequest = async function (request: HttpRequest): Promise<HttpResponse> {
    
    return await router.handle(request)
}
  • Addition of support for some cryptographic functions
    • crypto.createHash
    • crypto.createHmac
    • crytpo.subtle.digest

See below for the full list of changes.

What's Changed

Full Changelog: fermyon/spin-js-sdk@v0.2.0...v0.3.0