-
Notifications
You must be signed in to change notification settings - Fork 4
New API to load from CDN endpoint #106
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
Changes from 4 commits
5135f8e
f9984f1
48dca22
aee5fca
234ab73
db8b023
5aae5ea
a7124d8
c8c366d
263859d
e4421ec
084825d
cec0605
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,23 @@ export async function load( | |
| } | ||
| } | ||
|
|
||
| /** | ||
| * Loads the data from a CDN and returns an instance of AzureAppConfiguration. | ||
| * @param endpoint The URL to the CDN. | ||
| * @param options Optional parameters. | ||
| */ | ||
| export async function loadFromCdn(endpoint: URL | string, options?: AzureAppConfigurationOptions): Promise<AzureAppConfiguration>; | ||
|
|
||
| export async function loadFromCdn( | ||
| endpoint: string | URL, | ||
|
||
| appConfigOptions?: AzureAppConfigurationOptions | ||
| ): Promise<AzureAppConfiguration> { | ||
| const emptyTokenCredential: TokenCredential = { | ||
zhiyuanliang-ms marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| getToken: async () => ({ token: "", expiresOnTimestamp: 0 }) | ||
avanigupta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
| return await load(endpoint, emptyTokenCredential, appConfigOptions); | ||
| } | ||
|
|
||
| function instanceOfTokenCredential(obj: unknown) { | ||
| return obj && typeof obj === "object" && "getToken" in obj && typeof obj.getToken === "function"; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be updated too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird, I remembered I updated this in the commit, will update it again