Skip to main content
Module

x/fastro/server/deps.ts

Fast and simple web application framework for deno
Go to Latest
import * as fastro from "https://deno.land/x/fastro@v0.70.5/server/deps.ts";

Utility functions for media types (MIME types).

This API is inspired by the GoLang mime package and jshttp/mime-types, and is designed to integrate and improve the APIs from deno.land/x/media_types.

The vendor folder contains copy of the jshttp/mime-db db.json file along with its license.

Classes

Used to construct an HTTP server.

Enums

Standard HTTP status codes.

Functions

Make an assertion, error will be thrown if expr does not have truthy value.

Make an assertion that actual and expected are almost equal numbers through a given tolerance. It can be used to take into account IEEE-754 double-precision floating-point representation limitations. If the values are not almost equal then throw.

Make an assertion that actual includes the expected values. If not then an error will be thrown.

Make an assertion that actual and expected are equal, deeply. If not deeply equal, then throw.

Make an assertion that actual is not null or undefined. If not then throw.

Make an assertion that obj is an instance of type. If not then throw.

Make an assertion that error is an Error. If not then an error will be thrown. An error class and a string that should be included in the error message can also be asserted.

Make an assertion that actual match RegExp expected. If not then throw.

Make an assertion that actual and expected are not equal, deeply. If not then throw.

Make an assertion that obj is not an instance of type. If so, then throw.

Make an assertion that actual not match RegExp expected. If match then throw.

Make an assertion that actual and expected are not strictly equal. If the values are strictly equal then throw.

Make an assertion that actual object is a subset of expected object, deeply. If not, then throw.

Executes a function which returns a promise, expecting it to reject.

Make an assertion that actual and expected are strictly equal. If not then throw.

Make an assertion that actual includes expected. If not then throw.

Executes a function, expecting it to throw. If it does not, then it throws.

Determines the common path from a set of paths, using an optional separator, which defaults to the OS default separator.

Given an extension or media type, return a full Content-Type or Content-Disposition header value.

Set the cookie header with empty value in the headers to delete it

Deep equality comparison used in assertions

For a given media type, return the most relevant extension, or undefined if no extension can be found.

Returns the extensions known to be associated with the media type type. The returned extensions will each begin with a leading dot, as in .html.

Forcefully throws a failed assertion

Serializes the media type and the optional parameters as a media type conforming to RFC 2045 and RFC 2616.

Given a media type or header value, identify the encoding charset. If the charset cannot be determined, the function returns undefined.

Parse cookies of a header

Parse set-cookies of a header

Convert a glob string to a regular expression.

Test whether the given string is a glob

Like join(), but doesn't collapse "**/.." when globstar is true.

Like normalize(), but doesn't collapse "**/.." when globstar is true.

Parses the media type and any optional parameters, per RFC 1521. Media types are the values in Content-Type and Content-Disposition headers. On success the function returns a tuple where the first element is the media type and the second element is the optional parameters or undefined if there are none.

Serves HTTP requests with the given handler.

Set the cookie header properly in the headers

Returns the media type associated with the file extension. Values are normalized to lower case and matched irrespective of a leading ..

Use this to stub out methods that will throw when invoked.

Use this to assert unreachable code.

Interfaces

Information about the connection a request arrived on.

A parsed path object generated by path.parse() or consumed by path.format().

Additional serve options.