The Protevus Platform: Unified Full-Stack Development https://protevus.com
Find a file
2019-03-28 21:10:16 -04:00
example 1.0.0 2019-03-28 21:10:16 -04:00
lib 1.0.0 2019-03-28 21:10:16 -04:00
test 1.0.0 2019-03-28 21:10:16 -04:00
.gitignore Initial commit 2018-08-19 22:34:41 -04:00
analysis_options.yaml 1.0.0 2019-03-28 21:10:16 -04:00
CHANGELOG.md 1.0.0 2019-03-28 21:10:16 -04:00
LICENSE Initial commit 2018-08-19 22:34:41 -04:00
pubspec.yaml 1.0.0 2019-03-28 21:10:16 -04:00
README.md 1.0.0 2019-03-28 21:10:16 -04:00

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