Skip to main content
Module

x/peko/mod.ts

Featherweight full-stack framework for the stateless edge 🐣
Go to Latest
import * as peko from "https://deno.land/x/peko@v0.6.1/mod.ts";

Classes

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

Event emitter class, designed to be used with the sseHandler

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

Generates a caching middleware using provided ResponseCache instance

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

Streams Event data from provided Emitter to Response body

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

Generates Response with body from file URL, sets modifiable "Cache-Control" header and hashes file contents for "ETAG" header.