2024-06-06 12:49:18 +00:00
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
2024-05-18 10:17:16 +00:00
|
|
|
abstract class ServiceFinder {
|
2024-06-27 16:05:43 +00:00
|
|
|
static const bool devFlag = true;
|
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
|
|
|
};
|
2024-06-06 12:49:18 +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,
|
|
|
|
allowAutoSignedCert: true,
|
|
|
|
);
|
2024-06-06 12:49:18 +00:00
|
|
|
client.httpClient.baseUrl = ServiceFinder.services[service];
|
|
|
|
|
|
|
|
return client;
|
|
|
|
}
|
2024-05-25 16:11:00 +00:00
|
|
|
}
|