From ac36ba8318819e7a2932d4c028003446ae716a08 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Thu, 29 Mar 2018 19:55:28 -0400 Subject: [PATCH] Update boilerplate --- .idea/angel.iml | 1 + bin/dev.dart | 5 +++-- bin/prod.dart | 13 +++++++------ pubspec.yaml | 29 +++++++++++------------------ 4 files changed, 22 insertions(+), 26 deletions(-) diff --git a/.idea/angel.iml b/.idea/angel.iml index 377564b..eae1301 100644 --- a/.idea/angel.iml +++ b/.idea/angel.iml @@ -11,5 +11,6 @@ + \ No newline at end of file diff --git a/bin/dev.dart b/bin/dev.dart index e1972b1..2db404e 100644 --- a/bin/dev.dart +++ b/bin/dev.dart @@ -10,8 +10,9 @@ main() async { var hot = new HotReloader(() async { var app = new Angel()..lazyParseBodies = true; await app.configure(configureServer); - app.logger = new Logger('angel') - ..onRecord.listen(prettyLog); + app.logger = new Logger('angel'); + var sub = app.logger.onRecord.listen(prettyLog); + app.shutdownHooks.add((_) => sub.cancel()); return app; }, [ new Directory('config'), diff --git a/bin/prod.dart b/bin/prod.dart index 6793255..3113e83 100644 --- a/bin/prod.dart +++ b/bin/prod.dart @@ -17,11 +17,7 @@ void main() { } void isolateMain(int id) { - // Passing `startShared` to the constructor allows us to start multiple - // instances of our application concurrently, listening on a single port. - // - // This effectively lets us multi-thread the application. - var app = new Angel.custom(startShared); + var app = new Angel(); app.configure(configureServer).then((_) async { // In production, we'll want to log errors to a file. @@ -38,7 +34,12 @@ void isolateMain(int id) { } }); - var server = await app.startServer(hostname, port); + // Passing `startShared` to the constructor allows us to start multiple + // instances of our application concurrently, listening on a single port. + // + // This effectively lets us multi-thread the application. + var http = new AngelHttp.custom(app, startShared); + var server = await http.startServer(hostname, port); print( 'Instance #$id listening at http://${server.address.address}:${server.port}'); }); diff --git a/pubspec.yaml b/pubspec.yaml index c97173b..d4f021d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,29 +2,22 @@ name: angel description: An easily-extensible web server framework in Dart. publish_to: none # Ensure we don't accidentally publish our private code! ;) environment: - sdk: ">=1.19.0" + sdk: '>=2.0.0-dev <2.0.0' homepage: https://github.com/angel-dart/angel dependencies: - angel_framework: ^1.1.0-alpha # The core server library. - angel_serialize: ^1.0.0-alpha # Model definition metadata. - - angel_auth: ^1.1.0-alpha # Supports stateless authentication via JWT - angel_configuration: ^1.1.0-alpha # Loads application configuration, along with support for .env files. + angel_auth: ^1.1.0 # Supports stateless authentication via JWT + angel_configuration: ^1.1.0 # Loads application configuration, along with support for .env files. angel_cors: ^1.0.0 # CORS support - angel_jael: ^1.0.0-alpha # Server-side templating engine - angel_static: ^1.3.0-alpha # Static file server + angel_framework: ^1.1.0 # The core server library. + angel_jael: ^1.0.0 # Server-side templating engine + angel_serialize: ^2.0.0 # Model definition metadata. + angel_static: ^1.3.0 # Static file server angel_validate: ^1.0.0 # Allows for validation of input data dev_dependencies: angel_hot: ^1.1.0-alpha # Hot-reloading support. :) - angel_serialize_generator: ^1.0.0-alpha # Generates serialization code for models. - angel_test: ^1.1.0-alpha # Utilities for testing Angel servers. - build_runner: ^0.5.0 + angel_serialize_generator: ^2.0.0 # Generates serialization code for models. + angel_test: ^1.1.0 # Utilities for testing Angel servers. + build_runner: ^0.7.0 console: ^2.2.4 grinder: ^0.8.0 - test: ^0.12.13 -transformers: - # Injects data from application configuration into Dart code. - # - # Documentation: - # https://github.com/angel-dart/configuration - - angel_configuration + test: ^0.12.13 \ No newline at end of file