Skip to content

feat: Build time variable used to embed into other apps#598

Merged
fgiorgetti merged 3 commits into
skupperproject:mainfrom
fgiorgetti:embed
Jun 25, 2026
Merged

feat: Build time variable used to embed into other apps#598
fgiorgetti merged 3 commits into
skupperproject:mainfrom
fgiorgetti:embed

Conversation

@fgiorgetti

Copy link
Copy Markdown
Member

Description

Adds a build time variable named SKUPPER_CONSOLE_EMBED.
If set to true, then all resources and API address will be relative.
If not set nothing changes.

Additional context (optional)

The skupper-console will be build and used inside the VMS Management Server using SKUPPER_CONSOLE_EMBED=true.

How to test

Build as is and expect it to work as is.
Build is using: SKUPPER_CONSOLE_EMBED=true yarn build and it should use relative paths and API address.

@JPadovano1483 JPadovano1483 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This worked as described.

One small suggestion. You could add a script in the package.json file to run the build in embed mode. It may make it a bit easier for someone to find and run rather than just the README note.

"build:embed": SKUPPER_CONSOLE_EMBED=true yarn build

From looking at the VMS PR, it looks like the intention here is to send all api calls through the main app's api and then proxy to the network-observer api, probably to keep requests coming from the same origin. It may be worth noting this in the README that in embed mode, the main app must expose routes one level up from where the console is mounted that proxies to the observer api. Let me know though if my understanding is incorrect here.

@fgiorgetti

Copy link
Copy Markdown
Member Author

This worked as described.

One small suggestion. You could add a script in the package.json file to run the build in embed mode. It may make it a bit easier for someone to find and run rather than just the README note.

"build:embed": SKUPPER_CONSOLE_EMBED=true yarn build

Will do.

From looking at the VMS PR, it looks like the intention here is to send all api calls through the main app's api and then proxy to the network-observer api, probably to keep requests coming from the same origin. It may be worth noting this in the README that in embed mode, the main app must expose routes one level up from where the console is mounted that proxies to the observer api. Let me know though if my understanding is incorrect here.

Your understanding is correct. I will drop a node explaining the purpose for the API path used when using embed mode.

@fgiorgetti fgiorgetti requested a review from JPadovano1483 June 23, 2026 19:48
@fgiorgetti fgiorgetti marked this pull request as ready for review June 25, 2026 10:47

@pierpman pierpman left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me

@fgiorgetti fgiorgetti merged commit 98a128f into skupperproject:main Jun 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants