Skip to content

Commit 903f1a2

Browse files
committed
fastly url client paths
1 parent 64adf55 commit 903f1a2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ab-testing/config/lib/fastly/client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export type ServiceConfig = {
4242

4343
export class FastlyClient {
4444
apiToken: string;
45-
baseUrl: string = "https://api.fastly.com/service";
45+
baseUrl: string = "https://api.fastly.com";
4646

4747
constructor(apiToken: string, baseUrl?: string) {
4848
this.apiToken = apiToken;
@@ -84,7 +84,7 @@ export class FastlyClient {
8484
serviceId: string,
8585
serviceName: string,
8686
): Promise<FastlyService> {
87-
const serviceConfig = await this.fetch(serviceId);
87+
const serviceConfig = await this.fetch(`service/${serviceId}`);
8888

8989
assert(
9090
serviceConfig,
@@ -133,7 +133,7 @@ export class FastlyClient {
133133
serviceId: string;
134134
}): Promise<{ id: string; name: string }> {
135135
const dictionary = await this.fetch(
136-
`${serviceId}/version/${activeVersion}/dictionary/${dictionaryName}`,
136+
`service/${serviceId}/version/${activeVersion}/dictionary/${dictionaryName}`,
137137
);
138138
assert(dictionary, type({ id: string(), name: string() }));
139139

@@ -148,7 +148,7 @@ export class FastlyClient {
148148
serviceId: string;
149149
}): Promise<FastlyDictionaryItem[]> {
150150
const dictionary = await this.fetch(
151-
`${serviceId}/dictionary/${dictionaryId}/items?per_page=1000`,
151+
`service/${serviceId}/dictionary/${dictionaryId}/items?per_page=1000`,
152152
);
153153

154154
assert(dictionary, array(fastlyDictionaryItemStruct));
@@ -166,7 +166,7 @@ export class FastlyClient {
166166
items: UpdateDictionaryItemRequest[];
167167
}): Promise<{ status: string }> {
168168
const dictionary = await this.fetch(
169-
`${serviceId}/dictionary/${dictionaryId}/items`,
169+
`service/${serviceId}/dictionary/${dictionaryId}/items`,
170170
{
171171
method: "PATCH",
172172
headers: {

0 commit comments

Comments
 (0)