alfred library

Classes

Alfred
Server application class
HttpBody
A HTTP content body produced by HttpBodyHandler for either HttpRequest or HttpClientResponse.
HttpBodyFileUpload
A wrapper around a file upload.
HttpBodyHandler
A handler for processing and collecting HTTP message data in to an HttpBody.
HttpClientResponseBody
The body of a HttpClientResponse.
HttpRequest
A server-side object that contains the content of and information about an HTTP request.
HttpRequestBody
The body of a HttpRequest.
HttpResponse
An HTTP response, which returns the headers and data from the server to the client in response to an HTTP request.
HttpRoute
HttpRouteParam
Class used to retain parameter information (name, type, pattern)
HttpRouteParamType
NestedRoute
RequestStore
Key-Value-Store for reading and writing request-related data
TypeHandler<T>

Enums

DecodeMode
LogType
Indicates the severity of logged message
Method

Mixins

Router

Extensions

FileHelpers on File
A set of extensions on the file object which help in composing http responses
NestedRouteExtension on Alfred
PathNormalizer on String
RequestHelpers on HttpRequest
Some convenience methods on the HttpRequest object to make the api more like ExpressJS
ResponseHelpers on HttpResponse
A set of extensions on the HttpResponse object, mostly for convenience
StorePlugin on HttpRequest
Integrates RequestStore mechanism on HttpRequest

Properties

storePluginData Map<HttpRequest, RequestStore>
Data structure to keep all request-related data
final

Functions

cors({int age = 86400, String headers = '*', String methods = 'POST, GET, OPTIONS, PUT, PATCH, DELETE', String origin = '*'}) FutureOr Function(HttpRequest, HttpResponse)
CORS Middlware.
storePluginOnDoneHandler(HttpRequest req, HttpResponse res) → void
Used within Alfred to remove request-related data after the request has been resolved.

Exceptions / Errors

AlfredException
Throw these exceptions to bubble up an error from sub functions and have them handled automatically for the client
BodyParserException
DuplicateParameterException
Throws when a route contains duplicate parameters
NotFoundError
Error used by middleware, utils or type handler to elevate a NotFound response.
NoTypeHandlerError
Error thrown when a type handler cannot be found for a returned item