Alfredito class
A Very Good Project created by Very Good CLI.
Constructors
- Alfredito({FutureOr onNotFound(HttpRequest req, HttpResponse res)?, FutureOr onInternalError(HttpRequest req, HttpResponse res)?, LogType logLevel = LogType.info, int simultaneousProcessing = 50})
- A Very Good Project created by Very Good CLI.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- logWriter ↔ void Function(dynamic messageFn(), LogType type)
-
Writer to handle internal logging.
getter/setter pairinherited
- onInternalError ↔ (FutureOr Function(HttpRequest req, HttpResponse res)?)
-
Optional handler for when the server throws an unhandled error
getter/setter pairinherited
- onNotFound ↔ (FutureOr Function(HttpRequest req, HttpResponse res)?)
-
Optional handler for when a route is not found
getter/setter pairinherited
- requestQueue ↔ Queue
-
Incoming request queue
getter/setter pairinherited
-
routes
→ List<
HttpRoute> -
List of routes
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- server ↔ HttpServer?
-
HttpServer instance from the dart:io library
getter/setter pairinherited
-
typeHandlers
↔ List<
TypeHandler> -
An array of
TypeHandler
that Alfred walks through in order to determine if it can handle a value returned from a route.getter/setter pairinherited
Methods
-
all(
String path, FutureOr callback(HttpRequest req, HttpResponse res), {List< FutureOr Function(HttpRequest req, HttpResponse res)> middleware = const []}) → HttpRoute -
Create a route that listens on all methods
inherited
-
close(
{bool force = true}) → Future -
Close the server and clean up any resources
inherited
-
delete(
String path, FutureOr callback(HttpRequest req, HttpResponse res), {List< FutureOr Function(HttpRequest req, HttpResponse res)> middleware = const []}) → HttpRoute -
Create a delete route
inherited
-
get(
String path, FutureOr callback(HttpRequest req, HttpResponse res), {List< FutureOr Function(HttpRequest req, HttpResponse res)> middleware = const []}) → HttpRoute -
Create a get route
inherited
-
head(
String path, FutureOr callback(HttpRequest req, HttpResponse res), {List< FutureOr Function(HttpRequest req, HttpResponse res)> middleware = const []}) → HttpRoute -
Create a head route
inherited
-
listen(
[int port = 3000, dynamic bindIp = '0.0.0.0', int backlog = 0]) → Future< HttpServer> -
Call this function to fire off the server.
inherited
-
listenSecure(
{required SecurityContext securityContext, int port = 3000, dynamic bindIp = '0.0.0.0', int backlog = 0}) → Future< HttpServer> -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
options(
String path, FutureOr callback(HttpRequest req, HttpResponse res), {List< FutureOr Function(HttpRequest req, HttpResponse res)> middleware = const []}) → HttpRoute -
Create an options route
inherited
-
patch(
String path, FutureOr callback(HttpRequest req, HttpResponse res), {List< FutureOr Function(HttpRequest req, HttpResponse res)> middleware = const []}) → HttpRoute -
Create a patch route
inherited
-
post(
String path, FutureOr callback(HttpRequest req, HttpResponse res), {List< FutureOr Function(HttpRequest req, HttpResponse res)> middleware = const []}) → HttpRoute -
Create a post route
inherited
-
printRoutes(
) → void -
Print out the registered routes to the console
inherited
-
put(
String path, FutureOr callback(HttpRequest req, HttpResponse res), {List< FutureOr Function(HttpRequest req, HttpResponse res)> middleware = const []}) → HttpRoute -
Create a put route
inherited
-
registerOnDoneListener(
void listener(HttpRequest, HttpResponse)) → Function -
Register a listener when a request is complete
inherited
-
registerRoutes(
List< HttpRoute> routes) → void - A method to register route handlers.
-
removeOnDoneListener(
Function listener) → void -
Dispose of any on done listeners when you are done with them.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited