createNhostServiceEndpoint function
Generate Endpoint for each service and based on the subdomain
Implementation
String createNhostServiceEndpoint({
required String subdomain,
required String region,
required String service,
String apiVersion = 'v1',
String protocol = 'https',
}) {
if (region.isEmpty && subdomain == 'local') {
return '$protocol://$subdomain.$service.nhost.run/$apiVersion';
}
// production app, new subdomain approach
return '$protocol://$subdomain.$service.$region.nhost.run/$apiVersion';
}