A powerful real-time/REST/MVC server class.

Inheritance

Constructors

Angel()

Angel.secure(String certificateChainPath, String serverKeyPath, {String password})

Creates an HTTPS server. Provide paths to a certificate chain and server key (both .pem). If no password is provided, a random one will be generated upon running the server.

Properties

after → List

RequestMiddleware to be run after all requests.

read / write
before → List

RequestMiddleware to be run before all requests.

read / write
hashCode → int

Get a hash code for this object.

read-only, inherited
httpServer → HttpServer

The native HttpServer running this instancce.

read / write
properties → Map

A set of custom properties that can be assigned to the server.

read / write, inherited
requestMiddleware → Map<String, RequestMiddleware>

Additional filters to be run on designated requests.

read / write, inherited
routes → List<Route>

Dynamic request paths that this server will respond to.

read / write, inherited
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited
services → Map<Pattern, Service>

A set of Service objects that have been mapped into routes.

read / write, inherited
viewGenerator ViewGenerator

A function that renders views.

read / write

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

addRoute(String method, Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to the given path for requests with the given method (case-insensitive). Provide '*' as the method to respond to all methods.

inherited
all(Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to any request matching the given path.

inherited
configure(AngelConfigurer configurer(Angel app)) → Future

Applies an AngelConfigurer to this instance.

delete(Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to a DELETE request.

inherited
get(Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to a GET request.

inherited
listen({InternetAddress address, int port: 3000}) → void

Starts the server.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
onError(AngelErrorHandler handler(AngelHttpException err, RequestContext req, ResponseContext res)) → dynamic

Registers a callback to run upon errors.

patch(Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to a PATCH request.

inherited
post(Pattern path, Object handler, {List middleware}) Route

Adds a route that responds to a POST request.

inherited
registerMiddleware(String name, RequestMiddleware middleware(RequestContext req, ResponseContext res)) → dynamic

Assigns a middleware to a name for convenience.

inherited
service(Pattern path) Service

Retrieves the service assigned to the given path.

inherited
startServer(InternetAddress address, int port) → Future

Starts the server.

toString() → String

Returns a string representation of this object.

inherited
use(Pattern path, Routable routable, {bool hooked: true, String middlewareNamespace: null}) → dynamic

Incorporates another Routable's routes into this one's.