567ddd3897
git-subtree-dir: packages/mongo git-subtree-mainline:4ab233c5b6
git-subtree-split:6acfbc02d9
15 lines
431 B
Dart
15 lines
431 B
Dart
import 'package:angel_framework/angel_framework.dart';
|
|
import 'package:angel_mongo/angel_mongo.dart';
|
|
import 'package:mongo_dart/mongo_dart.dart';
|
|
|
|
main() async {
|
|
var app = new Angel();
|
|
Db db = new Db('mongodb://localhost:27017/local');
|
|
await db.open();
|
|
|
|
var service = app.use('/api/users', new MongoService(db.collection("users")));
|
|
|
|
service.afterCreated.listen((event) {
|
|
print("New user: ${event.result}");
|
|
});
|
|
}
|