本文介绍了Heroku:在Heroku上上传静态网站吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建自己的作品集,并使用HTML / CSS和Javascript创建了一个简单的etch-a-sketch项目。我正在尝试在Heroku上托管网站,但出现此错误:

I'm building my portfolio and made simple etch-a-sketch project with HTML/CSS and Javascript. I'm trying to host the site on Heroku but i'm getting this error:

remote:  !     No default language could be detected for this app.
remote:             HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote:             See https://devcenter.heroku.com/articles/buildpacks

此基本上是静态站点,我真的不需要buildpack,有什么办法可以将我必须使用的东西推送到Heroku吗?

This is basically a static site, I don't really need a buildpack, is there any way I can still push what I have to Heroku?

推荐答案

Heroku通常用于部署应用程序,而不是静态站点。我发现使用GitHub页面可轻松进行静态网站托管。如果您的项目已经在GitHub上,请转到存储库的设置选项卡,滚动到GitHub页面部分,然后选择要部署的存储库的哪个分支。 **编辑-只要确保您的首页html文件的标题为index.html

Heroku is normally used for deploying apps, not static sites. I find using GitHub pages to be much easier for static site hosting. If your project is already on GitHub just go to the settings tab of your repo, scroll to the GitHub pages section, and select which branch of your repo you want to deploy. **edit - Just make sure your home html file is titled index.html

,但是如果出于某些原因确实需要使用Heroku,则。它显示了如何创建静态站点所需的composer.json和index.php。

But if you do need to use Heroku for whatever reason, here is a guide on how to do so. It shows how to create the composer.json and index.php needed for a static site.

这篇关于Heroku:在Heroku上上传静态网站吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 00:07
查看更多