ops(dashboard-v2): fix SkynetClient on multi-server portals

This commit is contained in:
Michał Leszczyk 2022-04-14 18:33:39 +02:00
parent e4fe4dd901
commit babb6a48ad
No known key found for this signature in database
GPG Key ID: FA123CA8BAA2FBF4
1 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,6 @@
import { SkynetClient } from "skynet-js"; import { SkynetClient } from "skynet-js";
export default new SkynetClient(`https://${process.env.GATSBY_PORTAL_DOMAIN}`); const { NODE_ENV, GATSBY_PORTAL_DOMAIN } = process.env;
// In production-like environment, let SkynetClient figure out the best portal
export default new SkynetClient(NODE_ENV === "development" ? `https://${GATSBY_PORTAL_DOMAIN}` : undefined);