shelf_router_classes 1.0.3 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.
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);
}