From 30b1b9d838f844fc89377a1569e0ab794eb7f5ea Mon Sep 17 00:00:00 2001 From: bamurtaugh Date: Tue, 16 Mar 2021 15:59:13 +0000 Subject: [PATCH 1/2] Update remote ports and readme --- .devcontainer/devcontainer.json | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d1bcbb3..af38400 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,13 +10,7 @@ // Set *default* container specific settings.json values on container create. "settings": { - "terminal.integrated.shell.linux": "/bin/bash", - "remote.portsAttributes": { - "3000": { - "label": "My Port", - "onAutoForward": "notify" - } - } + "terminal.integrated.shell.linux": "/bin/bash" }, // Add the IDs of extensions you want installed when the container is created. @@ -30,6 +24,14 @@ // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "yarn install", + // Use 'portsAttributes' to set default properties for specific forwarded ports. + "portsAttributes": { + "3000": { + "label": "Hello Remote World", + "onAutoForward": "notify" + } + }, + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "node" } From c9e82647d877c909cbf4f41ef061ea1f6e700aef Mon Sep 17 00:00:00 2001 From: bamurtaugh Date: Tue, 16 Mar 2021 16:00:26 +0000 Subject: [PATCH 2/2] Readme change --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 44f8ded..b6bed6e 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Some things to try: - Continue (F5). You can connect to the server in the container by either: - Clicking on `Open in Browser` in the notification telling you: `Your service running on port 3000 is available`. - Clicking the globe icon in the 'Ports' view. The 'Ports' view gives you an organized table of your forwarded ports, and you can access it with the command **Ports: Focus on Ports View**. - - Notice port 3000 in the 'Ports' view is labeled "My Port." In `devcontainer.json`, you can set `"remote.portsAttributes"`, such as a label for your forwarded ports and the action to be taken when the port is autoforwarded. + - Notice port 3000 in the 'Ports' view is labeled "Hello Remote World." In `devcontainer.json`, you can set `"portsAttributes"`, such as a label for your forwarded ports and the action to be taken when the port is autoforwarded. > **Note:** In Remote - Containers, you can access your app at `http://localhost:3000` in a local browser. But in a browser-based Codespace, you must click the link from the notification or the `Ports` view so that the service handles port forwarding in the browser and generates the correct URL.