platform/packages/rethinkdb/example/example.dart
2024-10-12 18:45:27 -07:00

23 lines
642 B
Dart

import 'package:protevus_framework/protevus_framework.dart';
import 'package:protevus_rethinkdb/protevus_rethinkdb.dart';
import 'package:belatuk_rethinkdb/belatuk_rethinkdb.dart';
import 'package:logging/logging.dart';
void main() async {
RethinkDb r = RethinkDb();
var conn = await r.connect(
db: 'testDB',
host: "localhost",
port: 28015,
user: "admin",
password: "");
Protevus app = Protevus();
app.use('/todos', RethinkService(conn, r.table('todos')));
app.errorHandler = (e, req, res) async {
print('Whoops: $e');
};
app.logger = Logger.detached('protevus')..onRecord.listen(print);
}