Loading a static site on Heroku?
I am building my portfolio and made a simple etch-a-sketch project with HTML / CSS and Javascript. I am trying to host a site on Heroku, but I am getting this error:
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
This is basically a static site, I don't really need a buildpack, is there a way I can still push what I have to Heroku?
Heroku is generally used for deploying applications, not static sites. I find using GitHub pages is much easier for static site hosting. If your project is already on GitHub, go to the settings tab of your repo, navigate to the GitHub pages section and select which branch of your repo you want to deploy. ** edit - Just make sure your home html file is named index.html
But if you need to use Heroku for any reason, here's a guide on how to do it . It shows how to create the composer .json and index.php needed for a static site.
source to share
You can follow these steps:
1) Add a file named composer.json
to the root directory by runningtouch composer.json
2) Add a file named index.php
to the root directory by runningtouch index.php
3) Rename your home page (e.g. index.html) tohome.html
4) In index.php
add the following line:<?php include_once("home.html");?>
<?php include_once("home.html");?>
5) In composer.json
add the following line: {}
6) Rungit push heroku master
OR
While in your site directory, run these commands
1) $echo '{}' > composer.json
2) $echo '<?php include_once("home.html");?>' > index.php
echo '<?php include_once("home.html");?>' > index.php
3) $ mv index.html home.html
(if you already have index
HTML filename)
Thanks @ wh1tney Here is a link to her post.
Link: - https://gist.github.com/wh1tney/2ad13aa5fbdd83f6a489
source to share