galileo_typed_service 3.0.0 copy "galileo_typed_service: ^3.0.0" to clipboard
galileo_typed_service: ^3.0.0 copied to clipboard

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

typed_service #

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

Typically, package:galileo_serialize is recommended.

Brief Example #

main() async {
  var app = Galileo();
  var http = GalileoHttp(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}');
}
1
likes
30
pub points
0%
popularity

Publisher

verified publishergalileodart.com

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

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

galileo_framework, galileo_json_god

More

Packages that depend on galileo_typed_service