platform/test/common.dart

19 lines
433 B
Dart
Raw Normal View History

2016-11-23 22:03:06 +00:00
import 'package:angel_framework/angel_framework.dart';
2017-09-24 18:49:18 +00:00
import 'package:logging/logging.dart';
2016-11-23 22:03:06 +00:00
Angel testApp() {
2017-09-24 18:49:18 +00:00
final app = new Angel()..lazyParseBodies = true;
2016-11-23 22:03:06 +00:00
app.get('/hello', 'world');
app.get('/foo/bar', 'baz');
2017-09-24 18:49:18 +00:00
app.post('/body', (RequestContext req, res) async {
var body = await req.lazyBody();
print('Body: $body');
return body;
2017-04-02 02:06:27 +00:00
});
2017-09-24 18:49:18 +00:00
app.logger = new Logger('testApp');
2017-04-02 02:06:27 +00:00
return app..dumpTree();
}