angel_typed_service 1.0.1

Dart native

Angel services that use reflection to (de)serialize Dart objects.

typed_service #

Angel services that use reflection (via mirrors or codegen) to (de)serialize PODO's. Useful for quick prototypes.

Typically, package:angel_serialize is recommended.

Brief Example #

main() async {
  var app = Angel();
  var http = AngelHttp(app);
  var service = TypedService<String, Todo>(MapService());
  hierarchicalLoggingEnabled = true;
  app.use('/api/todos', service);

  app
    ..serializer = god.serialize
    ..logger = Logger.detached('typed_service')
    ..logger.onRecord.listen((rec) {
      print(rec);
      if (rec.error != null) print(rec.error);
      if (rec.stackTrace != null) print(rec.stackTrace);
    });

  await http.startServer('127.0.0.1', 3000);
  print('Listening at ${http.uri}');
}
0
likes
80
pub points
65%
popularity

Publisher

angel-dart.dev

Angel services that use reflection to (de)serialize Dart objects.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

angel_framework, json_god

More

Packages that depend on angel_typed_service