Merge pull request #81 from useblacksmith/use-backend-env

src: use the plumbed BLACKSMITH_BACKEND_URL if present
This commit is contained in:
Aditya Maru 2024-12-21 12:26:38 -05:00 committed by GitHub
commit 6a143ed7fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

2
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -10,9 +10,11 @@ import { Metric, Metric_MetricType } from "@buf/blacksmith_vm-agent.bufbuild_es/
// Configure base axios instance for Blacksmith API.
const createBlacksmithAPIClient = () => {
const apiUrl = process.env.BLACKSMITH_ENV?.includes('staging')
? 'https://stagingapi.blacksmith.sh'
: 'https://api.blacksmith.sh';
const apiUrl = process.env.BLACKSMITH_BACKEND_URL || (
process.env.BLACKSMITH_ENV?.includes('staging')
? 'https://stagingapi.blacksmith.sh'
: 'https://api.blacksmith.sh'
);
const client = axios.create({
baseURL: apiUrl,