shelf_router_classes 1.0.3 copy "shelf_router_classes: ^1.0.3" to clipboard
shelf_router_classes: ^1.0.3 copied to clipboard

An easier way to declare and use routes for the shelf and shelf_router packages using classes and Route annotations.

example/main.dart

import 'package:shelf/shelf.dart';
import 'package:shelf/shelf_io.dart';
import 'package:shelf_router/shelf_router.dart';
import 'package:shelf_router_classes/shelf_router_classes.dart';

import 'example_second_service.dart';
import 'example_service.dart';

void main(List<String> arguments) async {
  Router router = getRoutersByClass([ExampleService, ExampleSecondService]);
  await serve(logRequests().addHandler(router), 'localhost', 8080);
}
0
likes
160
pub points
5%
popularity

Publisher

verified publisherdbilgin.com

An easier way to declare and use routes for the shelf and shelf_router packages using classes and Route annotations.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

shelf_router

More

Packages that depend on shelf_router_classes