platform/bin/server.dart

20 lines
594 B
Dart
Raw Normal View History

2016-04-22 02:56:21 +00:00
import 'dart:async';
import 'dart:io';
import 'package:angel/angel.dart';
import 'package:angel_framework/angel_framework.dart';
main() async {
2016-04-29 01:22:53 +00:00
Angel app = await createServer();
2016-04-22 02:56:21 +00:00
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);
}
});
}