RelicApp class final

Implemented types
Available extensions

Constructors

RelicApp({bool useHostWhenRouting = false})
Creates a new RelicApp.

Properties

asHandler → Handler

Available on RelicRouter, provided by the RouterHandlerEx extension

Makes RelicRouter callable as a Handler.
no setter
delegate ↔ Router<Handler>
getter/setter pair
developerTools → DeveloperTools
Developer tools for inspecting and debugging the app.
latefinal
fallback ↔ Handler?
The fallback value returned when no route matches the request path.
getter/setter pairoverride
hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
Returns true if the router has no routes.
no setteroverride
isSingle → bool
Returns true if the router has a single root route ('/').
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
useHostWhenRouting → bool
Whether to prepend the request's Host header to the path during routing.
final

Methods

add(Method method, String path, Handler route) → void
Adds a route definition to the router.
override
attach(String path, RelicRouter subRouter, {bool consume = false}) → void
Attaches a sub-router to this router at the specified path.
override
call(Request req) → FutureOr<Result>

Available on RelicRouter, provided by the RouterHandlerEx extension

Similar to HandlerObject this extension allows a Router to be callable like a Handler.
close() → Future<void>
inject(RouterInjectable injectable) → void
Injects an injectable into the router. Unlike add it allows the injectable object to determine how to be mounted on the router.
override
injectAt(String path, RouterInjectable injectable) → void
Recreates the sub-router on each hot-reload replay instead of reusing the consumed (emptied) one from the first call.
override
lookup(Method method, String path, {bool backtrack = true}) → LookupResult<Handler>
Looks up a route matching the provided path.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(FutureOr<Adapter> adapterFactory(), {int noOfIsolates = 1, bool backtrack = true}) → Future<RelicServer>
Creates and starts a RelicServer with the configured routes.
serve({InternetAddress? address, int port = 8080, SecurityContext? securityContext, int backlog = 0, bool v6Only = false, bool shared = false, int noOfIsolates = 1}) → Future<RelicServer>

Available on RelicApp, provided by the RelicAppIOServeEx extension

Starts a HttpServer that listens on the specified address and port and sends requests to handler.
toString() → String
A string representation of this object.
inherited
use(String path, Middleware map) → void
Adds a middleware function to the router.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited