Solian/lib/services.dart

27 lines
806 B
Dart
Raw Normal View History

import 'package:get/get.dart';
2024-05-18 10:17:16 +00:00
abstract class ServiceFinder {
static const bool devFlag = false;
2024-05-18 10:17:16 +00:00
static Map<String, String> services = {
2024-05-25 16:11:00 +00:00
'paperclip':
devFlag ? 'http://localhost:8443' : 'https://usercontent.solsynth.dev',
2024-05-18 10:17:16 +00:00
'passport': devFlag ? 'http://localhost:8444' : 'https://id.solsynth.dev',
2024-05-25 16:11:00 +00:00
'interactive':
devFlag ? 'http://localhost:8445' : 'https://co.solsynth.dev',
'messaging': devFlag ? 'http://localhost:8447' : 'https://im.solsynth.dev',
2024-05-18 10:17:16 +00:00
};
static GetConnect configureClient(String service,
{timeout = const Duration(seconds: 5)}) {
2024-06-08 13:35:50 +00:00
final client = GetConnect(
timeout: timeout,
userAgent: 'Solian/1.1',
sendUserAgent: true,
2024-06-08 13:35:50 +00:00
);
client.httpClient.baseUrl = ServiceFinder.services[service];
return client;
}
2024-05-25 16:11:00 +00:00
}