feat: Add an example app and misc fixes (#81)

This commit is contained in:
Marcelo Mendonça Soares 2026-06-23 22:53:47 -03:00 • committed by GitHub
commit de7e22d91a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,12 +1,27 @@
import 'package:serverpod/serverpod.dart';
import 'package:serverpod_offline_sync_server/serverpod_offline_sync_server.dart'
hide Endpoints, Protocol;
import 'src/demo_auth.dart';
import 'src/demo_sync_tables.dart';
import 'src/generated/endpoints.dart';
import 'src/generated/protocol.dart';
/// The starting point of the Serverpod server.
Future<void> run(List<String> args) async {
// Initialize Serverpod and connect it with your generated code.
final pod = Serverpod(args, Protocol(), Endpoints());
final pod = Serverpod(
args,
Protocol(),
Endpoints(),
authenticationHandler: demoAuthenticationHandler,
// TODO: Remove the duplicate [syncTables] argument from here and the
// [initializeCrdtSync] call below.
databaseInterceptor: (_, inner) => CrdtDatabase(
inner,
syncTables: demoSyncTables,
),
)..initializeCrdtSync(syncTables: demoSyncTables);
// Start the server.
await pod.start();