angel_sembast 1.0.1
angel_sembast: ^1.0.1 copied to clipboard

package:sembast-powered CRUD services for the Angel framework.

example/main.dart

import 'package:angel_framework/angel_framework.dart';
import 'package:angel_framework/http.dart';
import 'package:angel_sembast/angel_sembast.dart';
import 'package:logging/logging.dart';
import 'package:sembast/sembast_io.dart';

main() async {
  var app = new Angel();
  var db = await databaseFactoryIo.openDatabase('todos.db');

  app
    ..logger = (new Logger('angel_sembast_example')..onRecord.listen(print))
    ..use('/api/todos', new SembastService(db, store: 'todos'))
    ..shutdownHooks.add((_) => db.close());

  var http = new AngelHttp(app);
  var server = await http.startServer('127.0.0.1', 3000);
  var uri =
      new Uri(scheme: 'http', host: server.address.address, port: server.port);
  print('angel_sembast example listening at $uri');
}
0
likes
80
pub points
0%
popularity

Publisher

angel-dart.dev

package:sembast-powered CRUD services for the Angel framework.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

angel_framework, sembast

More

Packages that depend on angel_sembast