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

前端 未结 10 1563
逝去的感伤
逝去的感伤 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条回答
  •  Happy的楠姐
    2020-12-04 06:59

    Here is a more elegant method: Just add a file called package.json which tells Heroku to use harp as your server:

    {
      "name": "my-static-site",
      "version": "1.0.0",
      "description": "This will load any static html site",
      "scripts": {
        "start": "harp server --port $PORT"
      },
      "dependencies": {
        "harp": "*"
      }
    }
    

    and then deploy to Heroku. Done!

    Further information: https://harpjs.com/docs/deployment/heroku

提交回复
热议问题