-
Notifications
You must be signed in to change notification settings - Fork 71
fix: use staging url for extensions on staging #6140
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 all commits
8f41be3
43647a0
cb0225e
92e23e0
24cb5b6
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 |
---|---|---|
|
@@ -2,26 +2,20 @@ import fetch from 'node-fetch' | |
|
||
import { TestOptions } from '../types/options.js' | ||
|
||
type AvailableIntegration = { | ||
slug: string | ||
hostSiteUrl: string | ||
hasBuild?: boolean | ||
} | ||
type AvailableIntegration = { slug: string; hostSiteUrl: string; hasBuild?: boolean } | ||
|
||
type GetAvailableIntegrationsOpts = { | ||
testOpts: TestOptions | ||
offline: boolean | ||
} | ||
type GetAvailableIntegrationsOpts = { testOpts: TestOptions; offline: boolean; extensionApiBaseUrl: string } | ||
|
||
export const getAvailableIntegrations = async function ({ | ||
testOpts, | ||
offline, | ||
extensionApiBaseUrl, | ||
}: GetAvailableIntegrationsOpts): Promise<AvailableIntegration[]> { | ||
if (offline) { | ||
return [] | ||
} | ||
const { host } = testOpts | ||
const baseUrl = new URL(host ? `http://${host}/` : `https://api.netlifysdk.com/`) | ||
const baseUrl = new URL(host ? `http://${host}/` : extensionApiBaseUrl) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we ever want to connect to the API over HTTP? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was wondering the same thing, but I think the assumption here is that the passed in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you mean because of the |
||
|
||
try { | ||
const response = await fetch(`${baseUrl}integrations`) | ||
|
Uh oh!
There was an error while loading. Please reload this page.