- Introduction
- Getting Started
- Gitpod Tutorial
- Use Cases
- Languages
- Configure
- Workspaces
- User settings
- Repositories
- Organizations
- Authentication
- Billing
- References
- .gitpod.yml
- IDEs & editors
- Integrations
- Gitpod CLI
- Gitpod API
- Gitpod URL
- Compatibility
- Enterprise
- Overview
- Setup and Preparation
- Deploying
- Configure your Gitpod Instance
- Administration
- Upgrading
- Background
- Reference
- Archive
- Help
- Contribute
- Troubleshooting
Step 3: Configure ports
When our application starts, you are automatically notified in the editor of opened ports. If you want to do things like automate the opening of a port in your browser tab, you can do that by configuring a ports
block in your .gitpod.yml
.
Let’s configure our application to open an editor preview for our front-end, and suppress notifications on our backend. Copy the following ports
block in your existing .gitpod.yml
configuration. As before, you’ll need to commit your changes and open a new workspace to view your changes.
.gitpod.yml
ports:
- name: front-end
port: 3000
onOpen: open-preview
- name: back-end
port: 3001
onOpen: ignore
visibility: public
When running, here’s how your workspace should open with VS Code: