mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
path method
This commit is contained in:
1 parent
72e052fe7e
commit
52fb116f3a
1 file changed
+6
@@ -39,6 +39,12 @@ export class StorytellerApiHostStore {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/** Convert an API path to a full URL using the configured scheme and host. */
|
||||
public pathToFullUrl(path: string): string {
|
||||
const trimmedPath = path.startsWith("/") ? path.slice(1) : path;
|
||||
return `${this.apiSchemeAndHost}/${trimmedPath}`;
|
||||
}
|
||||
|
||||
/** Get the API scheme and host. */
|
||||
public getApiSchemeAndHost(): string {
|
||||
console.debug("StorytellerApiHostStore.getApiSchemeAndHost()", this.apiSchemeAndHost, this.constructor.name);
|
||||
|
||||
Reference in new issue
Block a user