galileo_sembast 3.0.0
galileo_sembast: ^3.0.0 copied to clipboard

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

example/main.dart

import 'package:galileo_framework/galileo_framework.dart';
import 'package:galileo_framework/http.dart';
import 'package:galileo_sembast/galileo_sembast.dart';
import 'package:logging/logging.dart';
import 'package:sembast/sembast_io.dart';

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

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

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

Publisher

galileodart.com

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

Repository (missing)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

galileo_framework, sembast

More

Packages that depend on galileo_sembast