【问题标题】:How to host a static web page on Heroku如何在 Heroku 上托管静态网页
【发布时间】:2014-01-12 02:54:58
【问题描述】:

我创建了一个简单的单页响应式设计演示网站,我想在所有主要设备上进行测试。我想在本地机器上更改我的网站设计,然后将其部署到 Heroku,这样我就可以在多个设备上的公共网站上测试我的网站。

【问题讨论】:

    标签: heroku


    【解决方案1】:
    1. 创建新目录
    2. 在新目录中创建 index.html
    3. 使用touch index.php 创建 index.php(提示 Heroku 将 index.html 部署为 php 应用程序)
    4. git init
    5. git add index.php
    6. git add index.html
    7. git commit -m "Your comments..."
    8. heroku create
    9. git push heroku master
    10. 打开新 Heroku 应用的 URL 并在任何设备上查看您的静态网站

    要测试对本地网站的新更改,请重复步骤 6、7、9 和 10。

    优点:1) 通过 Heroku 在公共网络上部署您的网站不到一分钟; 2) 它是免费的。

    【讨论】:

    • 您可以在67 之间添加一个步骤是在Heroku 上禁用PHP(如果您不使用它),只需执行echo "php_flag engine off" > php.ini
    猜你喜欢
    • 1970-01-01
    • 2017-03-15
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    • 1970-01-01
    • 2018-09-14
    • 1970-01-01
    • 2019-09-02
    相关资源
    最近更新 更多