middleware_dart 1.0.0 copy "middleware_dart: ^1.0.0" to clipboard
middleware_dart: ^1.0.0 copied to clipboard

A platform for creating middleware inspired by middleware-io. It has many snippets and has no dependencies.

example/example.dart

// ignore_for_file: avoid_print

import 'package:middleware_dart/middleware_dart.dart';

void main() async {
  final composedMiddleware = compose([
    (context, next) async {
      print('step 1');
      await next();
      print('step 4');
    },
    (context, next) async {
      print('step 2');
      await next();
      print('step 3');
    }
  ]);

  await composedMiddleware([], () {
    print('Middleware finished work');
  });
}
2
likes
160
points
28
downloads

Publisher

unverified uploader

Weekly Downloads

A platform for creating middleware inspired by middleware-io. It has many snippets and has no dependencies.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on middleware_dart