Is it possible to upload a simple html and javascript file structure to heroku?

前端 未结 10 1552
逝去的感伤
逝去的感伤 2020-12-04 06:25

I\'m trying to deploy an open source project of mine to heroku, it is by necessity very simple with just static html and javascript. But do they not support static sites?

10条回答
  •  醉梦人生
    2020-12-04 06:58

    There's a very easy way to do it just in case anyone found the above answers hard to follow.

    You have your static website with the root at index.html (say), now you want to diploy it to Heroku, how?

    git init # initialise a git repo
    
    git add -A # add the files
    
    git commit -m "init commit" # commit the files
    
    # Now add two files in the root, composer.json and index.php like so - 
    touch composer.json
    touch index.php
    
    # Then add this line to index.php, making a PHP app and just asking it to display index.html - 
    
    
    # Now open composer.json and add an empty object - 
    {}
    

    Now simply run git push heroku master and you're done!

提交回复
热议问题