Skip to main content
Module

x/peko/mod.ts

Featherweight server/router framework + middleware and handler library 🐣
Go to Latest
import * as peko from "https://deno.land/x/peko@v1.2.2/mod.ts";

Classes

Crypto class, generates hashes and signs and verifies JWTs using provided key.

Response caching class, provides memoize method to be used on handlers or next() in middleware

Variables

Auth middleware, uses Crypto utility class to verify JWTs

Cache and serve responses using provided ResponseCache

Ctx.server.log middleware, awaits next() so logging happens after request is handled.

Streams "data" events from provided EventTarget to Response body. Call Response.body.cancel() to end.

Generates Response with SSRData.render result in body Sets headers "Content-Type" and "ETag" to "text/html" and bodyHash

Generates Response body from file URL and Content-Type and ETAG headers. Optionally: provide custom headers and/or body transform fcn.