简体   繁体   English

在heroku中部署HTML文件网站

[英]Deploying a html file website in heroku

I have build a small website using html, css, bootstrap and javascript files. 我已经使用html,css,bootstrap和javascript文件构建了一个小型网站。 The home page is index.html. 主页是index.html。 I tried to deploy it to my heroku app (buildpack is nodejs), but everytime is says: App not compatible with buildpack. 我试图将其部署到我的heroku应用程序(buildpack是nodejs),但每次都说:该应用程序与buildpack不兼容。 How can I upload my website there? 如何在那里上传我的网站?

This is what it shows: 它显示了以下内容:

D:\Projects\herokudeploy>git push heroku master Counting objects: 572, done. Delta compression using up to 4 threads. Compressing objects: 100% (477/477), done. Writing objects: 100% (572/572), 17.28 MiB |
48.00 KiB/s, done. Total 572 (delta 58), reused 570 (delta 57)
    remote: Compressing source files... done.
    remote: Building source:
    remote:
    remote: -----> App not compatible with buildpack: 
    https://github.com/heroku/heroku-buildpack-static.git
    remote:        More info: 
    https://devcenter.heroku.com/articles/buildpacks#detection-failure
    remote:
    remote:  !     Push failed
    remote: Verifying deploy...
    remote:
    remote: !       Push rejected to sobhannwebsite.
    remote:
    To *heroku url address*
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to *heroku url address*

When you set up a node application, Heroku will expect you to deploy a node app. 设置节点应用程序时,Heroku会期望您部署节点应用程序。 Currently I dont think you can just throw in a bunch of HTML and CSS on Heroku and run it. 目前,我不认为您可以在Heroku上投入大量HTML和CSS并运行它。 You need a Python, NodeJS, Go etc server for your app to run on. 您需要Python,NodeJS,Go等服务器才能运行您的应用程序。

The static buildpack you are using requires a static.json file to be runnable. 您使用的静态buildpack要求static.json文件是可运行的。 That file needs to be at the root of your repository. 该文件必须位于存储库的根目录下。

You should be able to set the content of that file to an empty hash, {} . 您应该能够将该文件的内容设置为空哈希{}
The buildpack readme on GitHub gives all the configuration you can set on that file for your static site. GitHub上的buildpack自述文件提供了您可以在该文件中为静态站点设置的所有配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM