Application class
Application is a class that contains the application.
Constructors
- Application()
-
Application is a constructor that creates a new Application object.
factory
Properties
- cache ↔ bool
-
cached is a boolean for enabling caching
getter/setter pair
-
cached
↔ Map<
String, dynamic> -
cached is a Map that contains the cached data of the application.
getter/setter pair
- corsOptions ↔ CorsOptions?
-
getter/setter pair
-
exceptionsAndErrosHandler
↔ Set<
ExceptionAndErrorResponse< FennecException, FennecError> > -
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- host ↔ dynamic
-
host represents host of the server
getter/setter pair
-
middlewares
→ List<
MiddlewareHandler> -
final
- numberOfIsolates ↔ int
-
numberOfIsolates is a int that contains the number of isolates of the application.
getter/setter pair
- port ↔ int
-
port represents port of the server
getter/setter pair
-
routers
→ List<
Router> -
final
-
routes
→ List<
ARoute> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- securityContext ↔ SecurityContext?
-
securityContext represents if you bind your server secure
getter/setter pair
- socketIOServer ↔ bool
-
getter/setter pair
- viewEngine ↔ String
-
viewEngine represents the used viewEngine
getter/setter pair
- viewPath ↔ String
-
viewPath represents the default path of views
getter/setter pair
- webSocket ↔ bool
-
getter/setter pair
Methods
-
addActor(
Actor actor) → Application -
addActors(
List< Actor> actors) → Application -
addRoute(
ARoute route) → Application -
addRoute is a method that adds a new Route to the application.
route
is a Route that contains the route. -
addRouter(
Router router) → Application -
addRouter is a method that adds a new Router to the application.
router
is a Router that contains the router. -
addRouters(
List< Router> routers) → Application -
addRouters is a method that adds a List Router to the application.
routers
is a List Router that contains the router. -
addRoutes(
List< ARoute> routes) → Application - addRoutes is a method that adds a a List of Route to the application.
-
any(
{List< RequestMethod> requestMethods = const [RequestMethod.all()], required String path, required RequestHandler requestHandler, List<MiddlewareHandler> middlewares = const []}) → Application -
delete(
{required String path, required RequestHandler requestHandler, List< MiddlewareHandler> middlewares = const []}) → Application -
dispose(
) → Future< void> -
get(
{required String path, required RequestHandler requestHandler, List< MiddlewareHandler> middlewares = const []}) → Application -
handleExceptionsAndErrors(
Set< ExceptionAndErrorResponse< exceptionsHandler) → ApplicationFennecException, FennecError> > -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
options(
{required String path, required RequestHandler requestHandler, List< MiddlewareHandler> middlewares = const []}) → Application -
patch(
{required String path, required RequestHandler requestHandler, List< MiddlewareHandler> middlewares = const []}) → Application -
pause(
) → Future< void> -
post(
{required String path, required RequestHandler requestHandler, List< MiddlewareHandler> middlewares = const []}) → Application -
put(
{required String path, required RequestHandler requestHandler, List< MiddlewareHandler> middlewares = const []}) → Application -
render(
String fileName, Map< String, dynamic> ? locals, dynamic callback(dynamic, String?), {Map<String, dynamic> parameters = const {}}) → void - render is a method that renders a view.
-
renderHtmlAsString(
String html, {Map< String, dynamic> parameters = const {}}) → String - renderHtmlAsString is a method that renders a html file by a String.
-
resume(
) → Future< void> -
runServer(
) → Future< ServerInfo> -
setCache(
bool cache) → Application - setCache is a method that enable caching of the application. by default it's set to false.
-
setCorsOptions(
CorsOptions corsOptions) → Application - setCorsOptions is used to add Cors to the response header
-
setHost(
dynamic host) → Application - setHost is a method that sets the host of server of the application. by default it's set to '0.0.0.0'.
-
setNumberOfIsolates(
int numberOfIsolates) → Application - setNumberOfIsolates is a method that sets the number of isolates of the application. by default it's set to 1.
-
setPort(
int port) → Application - setPort is a method that sets the port of server of the application. by default it's set to 8000.
-
setSecurityContext(
SecurityContext securityContext) → Application - setSecurityContext is a method that sets the SecurityContext of server of the application. by default it's set to null.
-
setViewEngine(
String viewEngine) → Application - setViewEngine is a method that sets the default viewEngine of views of the application.
-
setViewPath(
String viewPath) → Application - setViewPath is a method that sets the default path of views of the application.
-
socketIO(
{required SocketIOHandler socketIOHandler, List< MiddlewareHandler> middlewares = const [], String path = '/socket.io/'}) → Application -
toString(
) → String -
A string representation of this object.
inherited
-
useMiddleware(
MiddlewareHandler middlewareHandler) → Application - useMiddleware is used to defines middlewares, that will be executed after every request.
-
useSocketIOServer(
bool useSocketIOServer) → Application -
useWebSocket(
bool useWebSocket) → Application -
ws(
{required String path, required WebsocketHandler websocketHandler, List< MiddlewareHandler> middlewares = const []}) → Application
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited