在heroku中部署html文件网站

时间:2017-10-04 22:39:59

标签: javascript html css node.js heroku

我使用html,css,bootstrap和javascript文件构建了一个小型网站。主页是index.html。我试图将它部署到我的heroku应用程序(buildpack是nodejs),但每次都说:App与buildpack不兼容。我如何在那里上传我的网站?

这就是它所显示的:

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*

2 个答案:

答案 0 :(得分:1)

当您设置节点应用程序时,Heroku将期望您部署节点应用程序。目前我不认为你可以在Heroku上输入一堆HTML和CSS并运行它。您需要一个Python,NodeJS,Go等服务器才能运行您的应用程序。

答案 1 :(得分:0)

您使用的static buildpack要求static.json文件可以运行。该文件需要位于存储库的根目录。

您应该能够将该文件的内容设置为空哈希{} GitHub上的buildpack自述文件提供了您可以在静态站点的该文件上设置的所有配置。