Update boilerplate

This commit is contained in:
Tobe O 2018-03-29 19:55:28 -04:00
parent 9c1b8d18a3
commit ac36ba8318
4 changed files with 22 additions and 26 deletions

View file

@ -11,5 +11,6 @@
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" /> <orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component> </component>
</module> </module>

View file

@ -10,8 +10,9 @@ main() async {
var hot = new HotReloader(() async { var hot = new HotReloader(() async {
var app = new Angel()..lazyParseBodies = true; var app = new Angel()..lazyParseBodies = true;
await app.configure(configureServer); await app.configure(configureServer);
app.logger = new Logger('angel') app.logger = new Logger('angel');
..onRecord.listen(prettyLog); var sub = app.logger.onRecord.listen(prettyLog);
app.shutdownHooks.add((_) => sub.cancel());
return app; return app;
}, [ }, [
new Directory('config'), new Directory('config'),

View file

@ -17,11 +17,7 @@ void main() {
} }
void isolateMain(int id) { void isolateMain(int id) {
// Passing `startShared` to the constructor allows us to start multiple var app = new Angel();
// instances of our application concurrently, listening on a single port.
//
// This effectively lets us multi-thread the application.
var app = new Angel.custom(startShared);
app.configure(configureServer).then((_) async { app.configure(configureServer).then((_) async {
// In production, we'll want to log errors to a file. // 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( print(
'Instance #$id listening at http://${server.address.address}:${server.port}'); 'Instance #$id listening at http://${server.address.address}:${server.port}');
}); });

View file

@ -2,29 +2,22 @@ name: angel
description: An easily-extensible web server framework in Dart. description: An easily-extensible web server framework in Dart.
publish_to: none # Ensure we don't accidentally publish our private code! ;) publish_to: none # Ensure we don't accidentally publish our private code! ;)
environment: environment:
sdk: ">=1.19.0" sdk: '>=2.0.0-dev <2.0.0'
homepage: https://github.com/angel-dart/angel homepage: https://github.com/angel-dart/angel
dependencies: dependencies:
angel_framework: ^1.1.0-alpha # The core server library. angel_auth: ^1.1.0 # Supports stateless authentication via JWT
angel_serialize: ^1.0.0-alpha # Model definition metadata. angel_configuration: ^1.1.0 # Loads application configuration, along with support for .env files.
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_cors: ^1.0.0 # CORS support angel_cors: ^1.0.0 # CORS support
angel_jael: ^1.0.0-alpha # Server-side templating engine angel_framework: ^1.1.0 # The core server library.
angel_static: ^1.3.0-alpha # Static file server 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 angel_validate: ^1.0.0 # Allows for validation of input data
dev_dependencies: dev_dependencies:
angel_hot: ^1.1.0-alpha # Hot-reloading support. :) angel_hot: ^1.1.0-alpha # Hot-reloading support. :)
angel_serialize_generator: ^1.0.0-alpha # Generates serialization code for models. angel_serialize_generator: ^2.0.0 # Generates serialization code for models.
angel_test: ^1.1.0-alpha # Utilities for testing Angel servers. angel_test: ^1.1.0 # Utilities for testing Angel servers.
build_runner: ^0.5.0 build_runner: ^0.7.0
console: ^2.2.4 console: ^2.2.4
grinder: ^0.8.0 grinder: ^0.8.0
test: ^0.12.13 test: ^0.12.13
transformers:
# Injects data from application configuration into Dart code.
#
# Documentation:
# https://github.com/angel-dart/configuration
- angel_configuration