platform/test/for_browser_tests.dart

22 lines
505 B
Dart
Raw Normal View History

2016-06-25 18:37:49 +00:00
import 'dart:io';
2016-09-03 12:02:32 +00:00
import "package:angel_framework/angel_framework.dart";
2016-11-28 03:28:41 +00:00
import "package:angel_framework/src/defs.dart";
2016-06-25 18:37:49 +00:00
main() async {
Angel app = new Angel();
app.before.add((req, ResponseContext res) {
res.header("Access-Control-Allow-Origin", "*");
});
app.use("/todos", new MemoryService<Todo>());
2016-09-03 12:02:32 +00:00
await app.startServer(InternetAddress.LOOPBACK_IP_V4, 3001);
print("Server up on localhost:3001");
2016-06-25 18:37:49 +00:00
}
class Todo extends MemoryModel {
String hello;
Todo({String this.hello});
2016-09-03 12:02:32 +00:00
}