Visual Studio Code allows you to make a local application available on the web using a feature called “port forwarding”.
All you need to do is follow these steps:
- Open the current folder in Terminal (Ctrl + `)
- Start your server or run your build process and note down the port number
- Go to
ports
, add port and request forward - Open the context menu and set
visibility
topublic
- Copy the URL and you’re live - you can now send this URL to others to help you debug
- Deleting the port forward also makes the URL inactive
This is a an excellent way to temporalily share your app with the world without having to use a tunnel service like ngrok. Just be aware that you are effectively making your local machine available web-wide and thus also vulnerable to attacks. As a quick means to debug an app or show it to others for review, this is excellent but it should not be used as a way to publish your app to users.