Simple http request handler canister in Motoko

This example of canister allows you to handle the logic to serve http requests and parsing the path;

Example:

http://localhost:8000/?canisterId={canisterId}
would return root page :/

http://localhost:8000/metrics?canisterId={canisterId}
would return Metrics page :/metrics

Next step: Streaming strategy to allow clients to have a stream of data (video larger than egress limit)

9 Likes

Really cool, thanks for the snippet!

Interesting!
Thanks!