Closed timheuer closed 1 month ago
@justinyoo On this one did you try to load the localhost URI? Codespaces should be doing port forwarding and take care of this so you don't have to know of the github.dev URI.
For example clicking the localhost:18888 link in my codespace properly launched the dashboard using portforwarding:
I see what you are saying now -- misinterpreted as "the dashboard URI" -- you mean the endpoints of any apps listed in the dashboard are not going to 'just work' launched from the dashboard
FWIW, when running in a codespace there are some env vars that may help build up the clickable URI:
CODESPACES
- true/false when running in a codespaceCODESPACE_NAME
- the rando name of the runneland thus the localhost:port
portion of the scheme could be translated as {env.CODESPACE_NAME}-{port}.app.github.dev
I see what you are saying now -- misinterpreted as "the dashboard URI" -- you mean the endpoints of any apps listed in the dashboard are not going to 'just work' launched from the dashboard
That's correct. For example, the dashboard shows web app with http://localhost:5000
, within GitHub Codespaces, it should launch {env.CODESPACE_NAME}-5000.app.github.dev
.
Do any of you have a repository with aspire that is codespace ready that I can try?
@davidfowl Here's one https://github.com/timheuer/SimpleAspireStarterCodespace (has the devcontainer definition to install Aspire workloads)
Excellent! IT seems that after the vs code work lands one of the remaining pieces will be how we make the dashboard urls show the proxied addresses.
@davidfowl if you see a few comments up (https://github.com/dotnet/aspire/issues/1297#issuecomment-1847976960) the env vars will be written when in a codespace environment so Dashboard could check for existence of that and replace localhost.
Closing this in favor of #1178. In a comment I've left some code that works to remap the localhost addreses on the dashboard to proxied addreses.
The dashboard page literally seeks for
http://localhost:<port_number>
- It makes sense as long as it's on my local machine, but not on Codespaces. When it is running on GitHub Codespaces, it should openhttps://xxxxx-<port>.app.github.dev
.