Skip to main content
Module

x/peko/mod.ts

Featherweight HTTP routing + utils for stateless apps 🐣
Latest
import * as peko from "https://deno.land/x/peko@2.1.0/mod.ts";

Classes

Utility class for running middleware functions in a cascade

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

Variables

Auth middleware, uses Crypto utility class to verify JWTs

Configurable response cache for router, items stored in memory or via supplied options

Generic request info logging middleware. Awaits next() so log happens post request handling.

Merge source headers into base headers and return base

Recursively create an array of routes with the static handler for all files/sub-directories in the provided directory.

Streams type "send" CustomEvents from provided EventTarget to Response body. Routes using this handler should be requested via the EventSource browser API.

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

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