gpt4 book ai didi

node.js - 为 vuejs 应用程序提供服务的 Azure Web 应用程序

转载 作者:搜寻专家 更新时间:2023-10-30 22:35:35 25 4
gpt4 key购买 nike

我有一个使用webpack的vuejs应用,也可以打包成electron应用。

应用程序的结构如下:

https://github.com/kahwooi/vuetron

它可以在 webpack-dev-server 上运行。

我的问题是该应用程序可以在 Azure 或任何网络服务器上运行吗?

最佳答案

是的,一般来说,Azure Web Apps 作为网络服务平台为网络应用程序提供生产环境。因此,您可以尝试以下步骤来满足在 Azure 上运行 vuetron 的最简单要求。

  1. 在您的本地环境中安装 vuetron:

    # Install electron and webpack-dev-server 
    npm install -g electron webpack-dev-server

    # Install vue-cli and scaffold boilerplate
    npm install -g vue-cli
    vue init kahwooi/vuetron my-project

    # Install dependencies and run your app in development mode
    cd my-project
    npm install
    # View app using browser at http://localhost:8080, automatically updates the browser on changes.

    # Run as electron desktop app
    webpack
  2. 删除目录中 .gitignore 文件中的 /dist

  3. 通过 Azure-Cli 使用本地 git 部署创建 Web 应用程序:

    azure login
    azure config mode asm
    azure site create --git {your_site_name}
  4. 通过 Git 将您的应用程序部署到 Azure:

    git add .
    git commit -m "{your commit message}"
    git push azure master
  5. 最后,在浏览器中启动您的实时 Azure 应用:

    azure site browse

如有任何疑问,请随时告诉我。

关于node.js - 为 vuejs 应用程序提供服务的 Azure Web 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39770111/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com