diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 08217f5..e5569db 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,11 +21,11 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [3000], - // Use 'portsAttributes' to set default properties for specific forwarded ports. - // You can use a port number (i.e. 3000), range of numbers, or a regex to match the running process. + // Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference. "portsAttributes": { - ".+/server.js": { - "label": "Hello Remote World" + "3000": { + "label": "Hello Remote World", + "onAutoForward": "notify" } }, diff --git a/README.md b/README.md index 3dd7669..4083a81 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ Some things to try: **Open browser automatically:** As an example change, let's update the `portsAttributes` in the `.devcontainer/devcontainer.json` file to open a browser when our port is automatically forwarded. - Open the `.devcontainer/devcontainer.json` file. - - Modify your `portsAttributes` to include a new attribute (you can add it underneath the `label` attribute): `"onAutoForward": "openBrowser"`. + - Modify the `"onAutoForward"` attribute in your `portsAttributes` from `"notify"` to `"openBrowser"`. - Press F1 and select the **Remote-Containers: Rebuild Container** or **Codespaces: Rebuild Container** command so the modifications are picked up. ## Contributing