fix: dashboard: use service urls when running locally with the cli (#2622)

This commit is contained in:
Hassan Ben Jobrane
2024-04-04 10:28:38 +01:00
committed by GitHub
parent bcd889b53a
commit 93ebdf844f
2 changed files with 11 additions and 10 deletions

View File

@@ -0,0 +1,5 @@
---
'@nhost/dashboard': patch
---
fix: use service urls when initilizaing NhostClient running local dashboard

View File

@@ -3,18 +3,14 @@ import {
getFunctionsServiceUrl,
getGraphqlServiceUrl,
getStorageServiceUrl,
isPlatform,
} from '@/utils/env';
import { NhostClient } from '@nhost/nextjs';
// eslint-disable-next-line no-nested-ternary
const nhost = isPlatform()
? new NhostClient({
authUrl: getAuthServiceUrl(),
graphqlUrl: getGraphqlServiceUrl(),
functionsUrl: getFunctionsServiceUrl(),
storageUrl: getStorageServiceUrl(),
})
: new NhostClient({ subdomain: 'local' });
const nhost = new NhostClient({
authUrl: getAuthServiceUrl(),
graphqlUrl: getGraphqlServiceUrl(),
functionsUrl: getFunctionsServiceUrl(),
storageUrl: getStorageServiceUrl(),
});
export default nhost;