Update boilerplate
This commit is contained in:
parent
9c1b8d18a3
commit
ac36ba8318
4 changed files with 22 additions and 26 deletions
|
@ -11,5 +11,6 @@
|
|||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Dart SDK" level="project" />
|
||||
<orderEntry type="library" name="Dart Packages" level="project" />
|
||||
</component>
|
||||
</module>
|
|
@ -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'),
|
||||
|
|
|
@ -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}');
|
||||
});
|
||||
|
|
29
pubspec.yaml
29
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
|
Loading…
Reference in a new issue