protevus/bin/server.dart
regiostech e9875f6f20 :)
2016-04-28 21:22:53 -04:00

20 lines
No EOL
594 B
Dart

import 'dart:async';
import 'dart:io';
import 'package:angel/angel.dart';
import 'package:angel_framework/angel_framework.dart';
main() async {
Angel app = await createServer();
runZoned(() async {
await app.startServer(
new InternetAddress(app.properties['host']), app.properties['port']);
print("Angel server listening on ${app.httpServer.address.host}:${app
.httpServer.port}");
}, onError: (error, [StackTrace stackTrace]) {
stderr.writeln("Unhandled error occurred: $error");
if (stackTrace != null) {
stderr.writeln(stackTrace);
}
});
}