📌  相关文章
📜  https:cloud.google.com shell 文档 using-web-preview#previewing_the_application - SQL (1)

📅  最后修改于: 2023-12-03 14:42:01.029000             🧑  作者: Mango

Using the Google Cloud Shell Web Preview

The Google Cloud Shell Web Preview allows you to preview your web applications directly from the Cloud Shell without leaving the terminal. This feature is especially useful for developers who want to quickly test their applications or prototypes.

Prerequisites

Before using the Cloud Shell Web Preview, you need to have the following:

  • An active Google Cloud Shell session
  • A web application or webpage that you want to preview
Steps to Preview the Application
  1. Open your Google Cloud Shell session.

  2. Navigate to the directory where your web application is located using the following command:

    cd /path/to/your/application
    
  3. Start the Cloud Shell Web Preview by running the following command:

    web-preview
    
  4. The Cloud Shell web preview URL will be displayed in the terminal. Copy the URL and paste it into your web browser to see the application preview.

  5. You can now interact with your web application and test its functionality.

    Note: The web preview runs in a sandboxed environment, which means you can only access the resources and services available within the Cloud Shell.

  6. Once you are done testing, you can exit the Cloud Shell Web Preview by pressing Ctrl+C in the terminal session.

Limitations

There are a few limitations to keep in mind when using the Cloud Shell Web Preview:

  • The Cloud Shell Web Preview only supports HTTP, so applications using HTTPS may not work as expected.
  • The web preview environment has limited resources and is intended for testing and development purposes only. It is not meant for production use or handling high traffic.
  • The previewed application is accessible only to the user who initiated the Cloud Shell session. Other users cannot access the previewed application.
Conclusion

The Cloud Shell Web Preview is a convenient feature that allows developers to quickly preview and test web applications directly from the Google Cloud Shell. It provides a sandboxed environment and eliminates the need to switch between the terminal and web browser. Remember to consider the limitations and only use the web preview for testing and development purposes.

For more information, you can refer to the official Google Cloud Shell documentation.