tmcw-pekoexample.web.val.run
Readme

peko

This is an example of using the tiny peko example with Val Town - it's a small router that lets you build web apps using the standard Request & Response objects.

Peko just provides routing - matching URLs with functions - and lets you create your own Response object.

Server examples

1
2
3
4
5
6
7
export const pekoExample = async (request) => {
const Peko = await import("https://deno.land/x/peko@2.0.0/mod.ts");
const server = new Peko.Router();
server.get("/", () => new Response("Yes? There’s something at /hello"));
server.get("/hello", () => new Response("Hello world!"));
return server.requestHandler(request);
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023