[go: up one dir, main page]

Skip to content

Latest commit

 

History

History

example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Component example

This directory contains an example component implementing a simple "passthrough cache" service responsible for fetching the content bytes of a given URL from a supplied origin service.

The component imports two interfaces: a cache implementation for storing previously fetched content and an "origin" backend implementation for forwarding the request to when there is a cache miss.

It exports the same backend interface as it imports, effectively wrapping the provided import interface with some simplistic caching logic.

Building the component

To build the component, run the following command:

cargo component build

The component should now exist at target/wasm32-wasip1/debug/service.wasm.