Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/swedesjs/middleware_dart

A platform for creating middleware inspired by middleware-io. It has many snippets and has no dependencies.
https://github.com/swedesjs/middleware_dart

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

README

        

> **Middleware_Dart** - Library for middleware, inspired by [middleware-io](https://github.com/negezor/middleware-io)

# Features

1. **Self-sufficient.** The library has no dependencies
2. **Reliable.** The library is covered with tests
3. **Strong.** Supports the following additional features:
- The library has enough built-in snippets;
- Middleware chain designer;

# Example Usage

```dart
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');
});
}
```