App class

Lucifer Core App

Constructors

App({Duration? idleTimeout, int parallel = 50, bool shared = true, String? sslCertificate, String? privateKey, String? password})

Properties

environment String
no setter
hashCode int
The hash code for this object.
no setterinherited
host String
the host used by this app
no setter
idleTimeout Duration?
Gets or sets the timeout used for idle keep-alive connections. If no further request is seen within idleTimeout after the previous request was completed, the connection is dropped.
final
isDevelopment bool
no setter
isProduction bool
no setter
isTesting bool
no setter
parallel int
The number of requests that can be processed at one time.
final
port int
the port used by this app
no setter
routes List<Route>
List of HTTP Route assigned for each get,post,put,patch,delete methods.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shared bool
If shared is true and more HttpServers from this isolate or other isolates are bound to the port, then the incoming connections will be distributed among all the bound HttpServers.
final

Methods

addRoute(Route route) App
Create a new route and add it to the routes list
all(String path, dynamic middleware, [Callback? callback]) App
Register route for all HTTP method
checkRoutes() → void
Print out registered routes to the console.
close({bool force = false}) Future<void>
Close the server.
delete(String path, dynamic middleware, [Callback? callback]) App
Register a DELETE route
form() → FormParser
Expose FormParser to be used in a route handler
get(String path, dynamic middleware, [Callback? callback]) App
Register a GET route
Register a HEAD route
insertRoute(int index, Route route) App
listen(int port, [dynamic host, void onReady()?]) Future<void>
Start the server by listening to the specified host and port.
local<T>(String key, [dynamic value]) → T?
Returns local data associated with the specified key
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on(int errorCode, Callback callback) → void
Bind a custom error handler
options(String path, dynamic middleware, [Callback? callback]) App
Register an OPTIONS route
patch(String path, dynamic middleware, [Callback? callback]) App
Register a PATCH route
post(String path, dynamic middleware, [Callback? callback]) App
Register a POST route
put(String path, dynamic middleware, [Callback? callback]) App
Register a PUT route
removeLocal<T>(String key) → T?
Remove local data associated with the specified key
restart() Future<void>
Restart the server
route(String path, [Controller? controller]) Router
Use router directly in a chained way.
router([dynamic middleware]) Router
Create Router to be used later with app.use()
socket(Req req, Res res) SocketServer
Create a socket server
toString() String
A string representation of this object.
inherited
use(dynamic path, [dynamic middleware]) App
Register middleware(s) or apply a router

Operators

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