2024-10-13 01:45:27 +00:00
|
|
|
import 'package:protevus_framework/protevus_framework.dart';
|
|
|
|
import 'package:protevus_rethinkdb/protevus_rethinkdb.dart';
|
2024-06-30 01:44:37 +00:00
|
|
|
import 'package:belatuk_rethinkdb/belatuk_rethinkdb.dart';
|
|
|
|
import 'package:logging/logging.dart';
|
|
|
|
|
|
|
|
void main() async {
|
|
|
|
RethinkDb r = RethinkDb();
|
2024-07-02 16:13:02 +00:00
|
|
|
var conn = await r.connect(
|
|
|
|
db: 'testDB',
|
|
|
|
host: "localhost",
|
|
|
|
port: 28015,
|
|
|
|
user: "admin",
|
|
|
|
password: "");
|
2024-06-30 01:44:37 +00:00
|
|
|
|
2024-10-12 10:35:14 +00:00
|
|
|
Protevus app = Protevus();
|
2024-06-30 01:44:37 +00:00
|
|
|
app.use('/todos', RethinkService(conn, r.table('todos')));
|
|
|
|
|
|
|
|
app.errorHandler = (e, req, res) async {
|
|
|
|
print('Whoops: $e');
|
|
|
|
};
|
|
|
|
|
2024-10-12 10:35:14 +00:00
|
|
|
app.logger = Logger.detached('protevus')..onRecord.listen(print);
|
2024-06-30 01:44:37 +00:00
|
|
|
}
|