If you're developing within a GitHub Codespace, and would like to retrieve the URL of a forwarded port, then simply run the following command, specifying the port number that you'd like to retrieve the URL for:
npx -q codespaces-port <port>
The
-q
flag simply suppressesnpx
logging, and therefore, isn't strictly necessary.