feat: Build time variable used to embed into other apps#598
Conversation
JPadovano1483
left a comment
There was a problem hiding this comment.
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.
Will do.
Your understanding is correct. I will drop a node explaining the purpose for the API path used when using embed mode. |
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 buildand it should use relative paths and API address.