Skip to main content
Module

x/cav/util.ts

A server framework for Deno
Go to Latest
import * as cav from "https://deno.land/x/cav@0.0.21/util.ts";

Functions

Utility for creating an Rpc handler specifically for serving static assets. The resolver's path argument is used as the asset path.

Utility for creating an Rpc handler that always redirects. If an origin isn't provided in the redirect url, the origin of the request will be used. Paths can also be relative; if the path starts with a ".", the path will be joined with the pathname of the request using the std path.join() function. If the status isn't provided, 302 is used. Note that paths with trailing slashes will be redirected first to the path without the trailing slash before being redirect to the specified destination. (2 hops)

Type Aliases

Initializer options for the assets() utility function.