Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy HTML only app to Heroku?

Can I use Heroku to deploy an HTML prototype?

My HTML prototypes live on Github and Heroku would be a nice way to deploy them so clients can view them.

It seems that this is unsupported, since Heroku expects a Rails/NodeJS/[insert language here] structure or it won't run.

Push rejected, no Cedar-supported app detected

Are there any tricks to circumvent this?

like image 498
Wolfr Avatar asked Jun 27 '13 12:06

Wolfr


People also ask

Does Heroku support CSS?

Heroku allows web-hosting, but what do you know? They do not host static websites with HTML, CSS, and JS. After the anticipated relief of deploying a day's worth of hard work, the push failed log showed up.

Can I host a website on Heroku?

Heroku is a simple and one-stop solution to host any website or server.


2 Answers

The best solution would be to use a buildpack designed for hosting static content.

I'd suggest the experimental heroku/heroku-buildpack-static buildpack. In brief, just set the buildpack:

heroku buildpacks:set https://github.com/heroku/heroku-buildpack-static.git

And add a static.json indicating which directory contains your static assets:

{"root":"public"}
like image 134
Brad Koch Avatar answered Sep 20 '22 11:09

Brad Koch


The least effort solution is to rename your default file to index.php and redeploy. Heroku will detect it as a PHP site and use that buildpack.

Alternatively, you can follow this guide https://devcenter.heroku.com/articles/static-sites-ruby to set up a sinatra app to host it.

like image 27
John Beynon Avatar answered Sep 18 '22 11:09

John Beynon