GliderMiddleware class
Properties
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toString()
→ String
-
A string representation of this object.
inherited
Static Methods
-
auth({required Future<Map<String, dynamic>?> authenticate(String token), String scheme = 'Bearer'})
→ Middleware
-
-
cors({List<String> origins = const ['*'], List<String> methods = const ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS'], bool credentials = false})
→ Middleware
-
-
errorHandler({bool includeStackTrace = false, void onError(dynamic error, StackTrace stackTrace)?})
→ Middleware
-
Error handling middleware
-
jsonParser({int maxBodySize = 1024 * 1024})
→ Middleware
-
-
logger({void logFunction(String message)?})
→ Middleware
-
-
rateLimit({int maxRequests = 100, Duration window = const Duration(minutes: 1), String keyGenerator(GliderRequest request)?})
→ Middleware
-
-
validateBody<T extends GliderModel>(T constructor())
→ Middleware
-
Route-specific validation middleware
-
validateParams(Map<String, Validator> validators)
→ Middleware
-
Path parameter validation middleware
-
validateQuery(Map<String, Validator> validators)
→ Middleware
-
Query parameter validation middleware
-
validator<T extends GliderModel>(T constructor(), {String contextKey = 'validated_data'})
→ Middleware
-
Validation middleware for automatic request body validation