27 lines
825 B
Dart
27 lines
825 B
Dart
/// Runtime config for talking to `core-backend/`.
|
|
///
|
|
/// Override at run time with:
|
|
/// `flutter run --dart-define=CORE_API_BASE=http://10.0.2.2:8080`
|
|
class AppConfig {
|
|
static const coreApiBase = String.fromEnvironment(
|
|
'CORE_API_BASE',
|
|
defaultValue: 'http://10.0.2.2:8080', // Android emulator → host localhost
|
|
);
|
|
|
|
/// Shared demo invite (must match core-backend `demoInviteCode`).
|
|
/// Shown on the signup screen so other testers can join without admin mint.
|
|
static const demoInviteCode = 'DEMO-YKAVU';
|
|
static const demoDisplayName = '테스터';
|
|
|
|
|
|
static String wsBase() {
|
|
final uri = Uri.parse(coreApiBase);
|
|
final scheme = uri.scheme == 'https' ? 'wss' : 'ws';
|
|
return Uri(
|
|
scheme: scheme,
|
|
host: uri.host,
|
|
port: uri.hasPort ? uri.port : null,
|
|
).toString();
|
|
}
|
|
}
|