作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 flutter 中构建了一个 web 应用程序并成功运行命令 flutter build web。我试图找到一种方法将它部署在 Heroku 上,就像我的 React 应用程序一样,但在 heroku 文档中什么也没找到。
最佳答案
我们在 php 的帮助下运行 flutter web 或静态页面运行。我们可以使用许多其他语言。我们可以简单地使用 php 而无需更多工作。
第一的
之后会显示在heroku中创建应用程序。
运行后 flutter build web
在项目文件夹的根目录中,它将在 build/web 中生成静态内容。将文件复制到任何其他目录并像这样打开 cmd
创建两个文件 index.php 和 composer.json
在 index.php 中
添加这个
echo '<?php include_once("index.html"); ?>'
{}
`heroku login`
heroku git:clone -a appname
git add .
git commit -am "make it better
git push heroku master
运行后它可能会显示任何错误。如果不显示任何错误
关于flutter - 如何在 Heroku 上部署 Flutter Web,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62397807/
我是一名优秀的程序员,十分优秀!