Constants

BINARY → String

"binary"
DELETE → String

"DELETE"
ERROR_HANDLER → String

"ERROR_HANDLER"
FORM → String

"form"
GET → String

"GET"
INTERCEPTOR → String

"INTERCEPTOR"
JSON → String

"json"
POST → String

"POST"
PUT → String

"PUT"
ROUTE → String

"ROUTE"
TEXT → String

"text"

Typedefs

Handler(Injector injector) → dynamic

An interceptor or error handler, programmatically created by a plugin.

ParamProvider(metadata, Type paramType, String handlerName, String paramName, Request request, Injector injector) → Object

A parameter provider is a function that can create parameters for routes, interceptors and error handlers.

RedstonePlugin(Manager manager) → void

A plugin is a function which can dynamically add new features to an application.

ResponseProcessor(metadata, String handlerName, Object response, Injector injector) → Object

A response processor is a function, that can transform values returned by routes.

RouteHandler(Map<String, String> pathSegments, Injector injector, Request request) → dynamic

A route programmatically created by a plugin.

RouteWrapper(metadata, Map<String, String> pathSegments, Injector injector, Request request, RouteHandler route(Map<String, String> pathSegments, Injector injector, Request request)) → dynamic

A route wrapper created by a plugin.

Properties

chain Chain

The request's chain.

read-only
request Request

The request's information and content.

read-only
response → Response

The Response object, used for sending back the response to the client.

read / write

Functions

abort(int statusCode) → void

Abort the current request.

addModule(Module module) → void

Register a module for dependency injection.

addPlugin(RedstonePlugin plugin(Manager manager)) → void

Register a plugin.

addShelfMiddleware(Middleware middleware(Handler innerHandler(Request request))) → void

Register a Shelf Middleware.

authenticateBasic(String username, String password, {String realm}) → bool

Http Basic access authentication

dispatch(UnparsedRequest request) → Future<HttpResponse>

Dispatch a request.

handleRequest(HttpRequest request) → Future

Handle a HttpRequest.

parseAuthorizationHeader() Credentials

Parse authorization header from request.

redirect(String url) → void

Redirect the user to url.

serveRequests(Stream<HttpRequest> requests) → void

Serve a Stream of HttpRequests.

setShelfHandler(Handler handler(Request request)) → void

Register a Shelf Handler.

setUp([List<Symbol> libraries]) → void

Scan and initialize routes, interceptors and error handlers

setupConsoleLog([Level level = Level.INFO]) → void

Setup a simple log handler, that output messages to console.

start({address: _DEFAULT_ADDRESS, int port: _DEFAULT_PORT, bool autoCompress: false, Map<Symbol, dynamic> secureOptions}) → Future<HttpServer>

Start the server.

tearDown() → void

Remove all modules, plugins, routes, interceptors and error handlers.

Classes

AnnotatedType

Attr

An annotation to define a target parameter.

Body

An annotation to define a target parameter.

Chain

The chain of the given request.

Credentials

User credentials from request

DefaultRoute

An annotation to define a target which must be bound to the URL of its group.

ErrorHandler

An annotation to define error handlers.

ErrorHandlerMetadata

ErrorResponse

An error response.

Group

An annotation to define groups.

GroupMetadata

HandlerMetadata

HttpBody

The body of a HTTP request.

HttpBodyFileUpload

ported from the http_server package http://pub.dartlang.org/packages/http_server A form item that contains a file.

HttpRequestParser

HttpRequest parser

Ignore

Use this annotation to import a library without installing its handlers

Inject

An annotation to define a target parameter.

Install

An annotation to include handlers from other libraries

Interceptor

An annotation to define interceptors.

InterceptorMetadata

Manager

Allows to programmatically create routes, interceptors, error handlers, parameter providers and response processors.

QueryParam

An annotation to define a target parameter.

Request

The request's information and content.

Route

An annotation to define targets.

RouteMetadata

ServerMetadata

Allow access to all installed routes, interceptors, error handlers and groups that composes an application.

UnparsedRequest

A request whose body was not fully read yet

Exceptions / Errors

ChainException

RequestException

SetupException