Web Preview lets you run and test web applications directly from Cloud Shell in your browser—no deployment required.
Note
Web Preview is available only to Alibaba Cloud root accounts. RAM users cannot use this feature.
Prerequisites
Before you begin, ensure that you have:
An Alibaba Cloud root account
-
A web application that listens for HTTP requests on a port within the allowed range
Start a web application
Run a web application in Cloud Shell that listens on a port within the allowed range. The Cloud Shell proxy service restricts access to that port to your account only, over HTTPS.
To start a simple Python HTTP server for testing, run the following command:
cd `mktemp -d` \ && echo '<html><body>Hello World</body></html>' >./index.html \ && python -m http.server 60000Preview the application
Click Web Preview, then select your application's port from the menu. Cloud Shell opens the proxy URL in a new browser window.
该文章对您有帮助吗?