2017-10-04 202 views
0

我使用html,css,bootstrap和javascript文件構建了一個小型網站。主頁是index.html。我試圖將其部署到我的heroku應用程序(buildpack是nodejs),但每次都說:應用程序不兼容buildpack。我怎樣才能在那裏上傳我的網站?在heroku中部署html文件網站

這是它表明:

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* 

回答

1

當您設置一個節點應用,Heroku的指望你在部署節點的應用程序。目前我不認爲你可以在Heroku中插入一堆HTML和CSS並運行它。你需要一個Python,NodeJS,Go等服務器來運行你的應用程序。

0

您正在使用的static buildpack要求static.json文件可以運行。該文件需要位於存儲庫的根目錄下。

您應該可以將該文件的內容設置爲空散列{}
GitHub上的buildpack自述文件提供了您可以在該文件中爲靜態網站設置的所有配置。