aim_functions library
Cloud Functions for Firebase adapter for the Aim framework.
Runs an Aim application as a Cloud Functions onRequest HTTP function.
See AimFunctions.serveFunction for usage.
Classes
-
Aim<
E extends Variables> - A modern, simple, and fast web framework for Dart.
- Body
- The body of a request or response.
-
Context<
E extends Variables> - Context provides a simple API for handling HTTP requests and responses.
- EmptyVariables
- Default variables type used when no custom Variables is specified.
- Request
- An HTTP request to be processed by an Aim application.
- Response
- The response returned by a Handler.
-
Route<
E extends Variables> - Internal class representing a route with path pattern matching.
- Variables
- Base class for per-request typed context variables.
Mixins
- MessageMixin
- Mixin that provides common functionality for HTTP messages.
Extensions
-
AimFunctions
on Aim<
E> - Runs an Aim application as a Cloud Functions for Firebase HTTP function.
- ShelfRequestAccess on Request
- Typed access to the underlying shelf request.
Typedefs
- EmptyEnv = EmptyVariables
- Former name of EmptyVariables. Will be removed in a future release.
- Env = Variables
- Former name of Variables. Will be removed in a future release.
-
ErrorHandler<
E extends Variables> = Future< Response> Function(Object error, Context<E> c) - A function that handles errors that occur during request processing.
-
Handler<
E extends Variables> = Future< Response> Function(Context<E> c) - A function that handles an HTTP request and returns a response.
-
Middleware<
E extends Variables> = Future< void> Function(Context<E> c, Next next) - A function that processes requests in a middleware chain.
-
Next
= Future<
void> Function() - A function that calls the next middleware in the chain.
- ShelfRequest = Request
-
A name for
shelf.Requestthat the public barrel can export without colliding withaim_core's own Request (the two can't both be exported under the nameRequestfrom the same library — that's anambiguous_export, not merely anambiguous_importa caller could work around). This lets ShelfRequestAccess.shelfRequest's return type be written out by a caller who imports onlypackage:aim_functions, without addingshelfto their own pubspec. -
UnhandledErrorHandler<
E extends Variables> = Future< Response> Function(Object error, StackTrace stackTrace, Context<E> c) - A function that handles an error when no Aim.onError handler is registered. Receives the stack trace so adapters can log it.