angel_framework library

An easily-extensible web server framework in Dart.

Classes

Angel
A powerful real-time/REST/MVC server class.
AngelBase
Base class for Angel servers. Do not bother extending this.
AngelHttp
Adapts dart:io's HttpServer to serve Angel.
AnonymousService
An easy helper class to create one-off services without having to create an entire class. [...]
ConstantSegment
Container
Controller
Supports grouping routes with shared functionality.
CookieValue
Shortcut for declaring a request cookie Parameter.
Expose
Exposes a Controller to the Internet.
FileUploadInfo
Represents a file uploaded to the server.
Shortcut for declaring a request header Parameter.
HookedService
Wraps another service in a service that broadcasts events on actions.
HookedServiceEvent
Fired when a hooked service is invoked.
HookedServiceEventDispatcher
Can be listened to, but events may be canceled.
Hooks
Attaches hooks to a HookedService.
HttpRequestContextImpl
An implementation of RequestContext that wraps a HttpRequest.
HttpResponseContextImpl
InjectionRequest
Contains a list of the data required for a DI-enabled method to run. [...]
MapService
A basic service that manages an in-memory list of maps.
Middleware
Annotation to map middleware onto a handler.
MiddlewarePipeline
A chain of arbitrary handlers obtained by routing a path.
Model
Represents arbitrary data, with an associated ID and timestamps.
OptionalSegment
Parameter
Used to apply special dependency injections or functionality to a function parameter.
ParameterSegment
Providers
Indicates how the service was accessed. [...]
Query
Shortcut for declaring a request query Parameter.
RequestContext
A convenience wrapper around an incoming HTTP request.
ResponseContext
A convenience wrapper around an outgoing HTTP request.
Routable
A routable server that can handle dynamic requests.
Route
Represents a virtual location within an application.
RouteDefinition
RouteGrammar
Router
An abstraction over complex Route trees. Use this instead of the raw API. :)
RouteSegment
RoutingResult
Represents a complex result of navigating to a path.
Service
A front-facing interface that can present data to and operate on data on behalf of the user. [...]
Session
Shortcut for declaring a request session Parameter.
SymlinkRoute
Placeholder Route to serve as a symbolic link to a mounted Router.
TypedService<T>
WildcardSegment

Functions

createDynamicHandler(Function handler, { Iterable<String> optional: const [] }) RequestHandler
Shortcut for calling preInject, and then handleContained. [...]
flatten(Router router) Router
Optimizes a router by condensing all its routes into one level.
handleContained(Function handler, InjectionRequest injection) RequestHandler
Handles a request with a DI-enabled handler.
preInject(Function handler) InjectionRequest
Predetermines what needs to be injected for a handler to run.
resolveInjection(dynamic requirement, InjectionRequest injection, RequestContext req, ResponseContext res, bool throwOnUnresolved) → dynamic
startShared(dynamic address, int port) Future<HttpServer>
Boots a shared server instance. Use this if launching multiple isolates
startSharedSecure(SecurityContext securityContext) Future<HttpServer> Function(dynamic, int)
suitableForInjection(RequestContext req, ResponseContext res, InjectionRequest injection) bool
Checks if an InjectionRequest can be sufficiently executed within the current request/response context.
waterfall(List handlers) RequestMiddleware
Sequentially runs a list of handlers of middleware, and returns early if any does not return true. Works well with Router.chain.

Typedefs

AngelConfigurer(Angel app) FutureOr
A function that configures an Angel server in some way.
HookedServiceEventListener(HookedServiceEvent event) → dynamic
Triggered on a hooked service event.
RequestHandler(RequestContext req, ResponseContext res) FutureOr
A function that receives an incoming RequestContext and responds to it.
RequestMiddleware(RequestContext req, ResponseContext res) Future<bool>
A function that intercepts a request and determines whether handling of it should continue.
ResponseSerializer(dynamic data) String
Serializes response data into a String. [...]
ServerGenerator(dynamic address, int port) Future<HttpServer>
A function that binds an Angel server to an Internet address and port. [...]
ViewGenerator(String path, [ Map data ]) Future<String>
A function that asynchronously generates a view from the given path and data.

Exceptions / Errors

AngelHttpException
Basically the same as feathers-errors.
ContainerException
An Exception thrown when an instantiation failed. It is thrown, caught and rethrown to that we can see the stack of failing instantiations. [...]
RoutingException
Represents an error in route configuration or navigation.