Skip to content

Commit

Permalink
Merge pull request #583 from logion-network/feature/fix-base-url
Browse files Browse the repository at this point in the history
Use persistent base URL
  • Loading branch information
gdethier authored Jun 26, 2024
2 parents 5d425f1 + fdeff86 commit 98d86ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 1 addition & 4 deletions public/config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
let CONFIG = {
// Uncomment below lines to provide runtime configuration.
// APP_NAME: "Logion Wallet",
// directory: "http://localhost:8090/api",
// rpcEndpoints: [ "ws://localhost:9944" ]
// See `ConfigType`
};
3 changes: 2 additions & 1 deletion src/PublicPaths.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { UUID, Hash } from "@logion/node-api";
import config from "src/config";

export const PUBLIC_PATH = "/public";
export const CERTIFICATE_RELATIVE_PATH = "/certificate/:locId";
Expand Down Expand Up @@ -49,7 +50,7 @@ export function fullTokensRecordsCertificate(locId: UUID, recordId: Hash, noRedi
}

export function getBaseUrl(): string {
return `${ window.location.protocol }//${ window.location.host }`;
return config.baseUrl || `${ window.location.protocol }//${ window.location.host }`;
}

export const SECRET_RECOVERY_RELATIVE_PATH = "/secret-recovery";
Expand Down
4 changes: 2 additions & 2 deletions src/config/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import { EnvironmentString } from "@logion/client";
export interface ConfigType {
environment: EnvironmentString | undefined,
APP_NAME: string,
directory: string,
rpcEndpoints: string[],
crossmintApiKey: string,
logionClassification: string,
creativeCommons: string,
baseUrl: string | undefined,
}

export const DEFAULT_CONFIG: ConfigType = {
environment: undefined,
APP_NAME: "Logion Wallet",
directory: "",
rpcEndpoints: [],
crossmintApiKey: "",
logionClassification: "",
creativeCommons: "",
baseUrl: undefined,
};

export interface EnvConfigType extends Record<string, any> {
Expand Down

0 comments on commit 98d86ca

Please sign in to comment.