Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use persistent base URL #583

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading