Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

feat(api): Allow configuring the API URL at runtime #1687

Merged
merged 2 commits into from
Apr 27, 2023
Merged

feat(api): Allow configuring the API URL at runtime #1687

merged 2 commits into from
Apr 27, 2023

Conversation

lordrip
Copy link
Collaborator

@lordrip lordrip commented Apr 24, 2023

Context

Currently, the API URL is retrieved using an environment variable available at build time only. This creates friction in the VSCode extension context as it blocks running more than one instance of it.

Changes

This commit adds a constructor parameter to optionally receive the API URL so it can be overridden through the VSCode bootstrap process.

The API URL still defaults to the same environment variable provided at build time.

Example running at port :9000

image

fixes: 1451

Currently, the API URL is retrieved using an environment variable
available at build time only. This creates friction in the VSCode
extension context as it blocks running more than one instance of it.

This commit adds a constructor parameter to optionally receive the
API URL so it can be overridden through the VSCode bootstrap process.

The API URL still defaults to the same environment variable provided
at build time.

fixes: [1451](#1451)
@lordrip lordrip requested a review from a team April 24, 2023 12:41
@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Merging #1687 (f9ee892) into main (7976f19) will decrease coverage by 0.12%.
The diff coverage is 54.76%.

@@            Coverage Diff             @@
##             main    #1687      +/-   ##
==========================================
- Coverage   65.59%   65.48%   -0.12%     
==========================================
  Files          71       71              
  Lines        2058     2063       +5     
  Branches      470      470              
==========================================
+ Hits         1350     1351       +1     
- Misses        666      670       +4     
  Partials       42       42              
Impacted Files Coverage Δ
src/api/apiService.ts 29.54% <35.71%> (ø)
src/api/requestService.ts 62.96% <62.96%> (ø)
src/api/index.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@lordrip lordrip merged commit aba1e4d into kaoto-archive:main Apr 27, 2023
@lordrip lordrip deleted the feat/config-apiurl-at-runtime branch May 6, 2023 17:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow configuration at runtime of the url to reach the backend
2 participants