Update dev.dart
This commit is contained in:
parent
b70c3bb26f
commit
09861238a1
1 changed files with 11 additions and 8 deletions
19
bin/dev.dart
19
bin/dev.dart
|
@ -1,21 +1,24 @@
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
import 'package:angel/src/pretty_logging.dart';
|
||||||
import 'package:angel/angel.dart';
|
import 'package:angel/angel.dart';
|
||||||
import 'package:angel_container/mirrors.dart';
|
import 'package:angel_container/mirrors.dart';
|
||||||
import 'package:angel_framework/angel_framework.dart';
|
import 'package:angel_framework/angel_framework.dart';
|
||||||
import 'package:angel_hot/angel_hot.dart';
|
import 'package:angel_hot/angel_hot.dart';
|
||||||
import 'package:lumberjack/lumberjack.dart';
|
import 'package:logging/logging.dart';
|
||||||
import 'package:lumberjack/io.dart';
|
|
||||||
|
|
||||||
main() async {
|
main() async {
|
||||||
// Watch the config/ and web/ directories for changes, and hot-reload the server.
|
// Watch the config/ and web/ directories for changes, and hot-reload the server.
|
||||||
var hot = HotReloader(() async {
|
var hot = new HotReloader(() async {
|
||||||
var app = Angel(reflector: MirrorsReflector());
|
var app = new Angel(reflector: MirrorsReflector());
|
||||||
await app.configure(configureServer);
|
await app.configure(configureServer);
|
||||||
app.logger = Logger('angel')..pipe(AnsiLogPrinter.toStdout());
|
hierarchicalLoggingEnabled = true;
|
||||||
app.shutdownHooks.add((_) => app.logger.close());
|
app.logger = new Logger('angel');
|
||||||
|
var sub = app.logger.onRecord.listen(prettyLog);
|
||||||
|
app.shutdownHooks.add((_) => sub.cancel());
|
||||||
|
return app;
|
||||||
}, [
|
}, [
|
||||||
Directory('config'),
|
new Directory('config'),
|
||||||
Directory('lib'),
|
new Directory('lib'),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
var server = await hot.startServer('127.0.0.1', 3000);
|
var server = await hot.startServer('127.0.0.1', 3000);
|
||||||
|
|
Loading…
Reference in a new issue