Skip to content

Commit 5e7dc21

Browse files
committed
Allow environment variable to override records URL for testing purposes.
1 parent 1570672 commit 5e7dc21

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/app.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ type RSEndpointKey = keyof typeof RS_ENDPOINTS;
2121
* @returns The URL for the records endpoint.
2222
*/
2323
function getRecordsUrl(rsOrigin: string): string {
24+
// Allow ENV to override the URL for testing.
25+
if (import.meta.env.VITE_RS_RECORDS_URL) {
26+
return import.meta.env.VITE_RS_RECORDS_URL;
27+
}
2428
return `${rsOrigin}/v1/buckets/main/collections/url-classifier-exceptions/records`;
2529
}
2630

0 commit comments

Comments
 (0)