Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/cli/src/services/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ class ChecklyConfig {
}

getApiUrl (): string {
// Allow overriding the API URL via CHECKLY_BASE_URL environment variable
if (process.env.CHECKLY_BASE_URL) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty much only needed for local development. Let me know if you prefer moving this to line 87 as local: process.env.CHECKLY_BASE_URL || 'http://127.0.0.1:3000'.
See the PR description for more context.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we move it to 87 then the user also needs to add the env for local (so 2 envs) this way we override everything by just setting one env 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this works but how about the getMqttUrl below?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sorccu good point! The local MQTT server also needs to be tunneled and the URL overwritten. I haven't worked on this part yet on the FE side. I'll put this PR back into draft until I've tested that fully.

return process.env.CHECKLY_BASE_URL
}

const environments = {
local: 'http://127.0.0.1:3000',
development: 'https://api-dev.checklyhq.com',
Expand All @@ -88,6 +93,10 @@ class ChecklyConfig {
}

getMqttUrl (): string {
if (process.env.CHECKLY_MQTT_URL) {
return process.env.CHECKLY_MQTT_URL
}

const environments = {
local: 'wss://events-local.checklyhq.com',
development: 'wss://events-dev.checklyhq.com',
Expand Down
Loading