platform/test/common.dart

21 lines
523 B
Dart
Raw Normal View History

import 'dart:async';
import 'dart:io';
import 'package:angel_framework/angel_framework.dart';
2016-09-17 20:00:17 +00:00
import 'package:angel_framework/src/defs.dart';
class Todo extends MemoryModel {
String text;
String when;
Todo({String this.text, String this.when});
}
Future startTestServer(Angel app) async {
var host = InternetAddress.LOOPBACK_IP_V4;
var port = 3000;
await app.startServer(host, port);
app.properties["ws_url"] = "ws://${host.address}:$port/ws";
print("Test server listening on ${host.address}:$port");
}