Live data from Hacker News

Static Sites on Heroku

anti-pattern.com

31–40 of 41 posts

Re: Static Sites on Heroku

#33
post #26

Earlier quoted context omitted.

can you explain more about the nginx thing? Since it's a GitHub repo, why you need a web server?

Oh, I guess I could use GitHub hosting, but I wanted to host it on my own server. (I actually have a good reason to - I needed to access a WebSocket server on the same origin)

I think the big advantage for people wanting to host a site on Heroku is they explicitly DON'T need their "own server".

Re: Static Sites on Heroku

#34

You know, static hosting works really great on Amazon S3, as long as you don't need a .htaccess file. On all of my jekyll sites I use S3 now and there's even a jekyll-s3 gem that makes pushing your site up to S3 painless. The nice thing about using S3 is you don't have to wait for Heroku instance start up if it's not a high traffic site.

The only issue with S3 I've found is the lack of naked domain support, so you need another service for redirects to your *.domain.tld.

Re: Static Sites on Heroku

#35
post #34

You know, static hosting works really great on Amazon S3, as long as you don't need a .htaccess file. On all of my jekyll sites I use S3 now and there's even a jekyll-s3 gem that makes pushing your site up to S3 painless. The nice thing about using S3 is you don't have to wait for Heroku instance start up if it's not a high traffic site.

The only issue with S3 I've found is the lack of naked domain support, so you need another service for redirects to your *.domain.tld.

If you register your domain through NameCheap and use their DNS hosting, HTTP redirects from naked domains are included.

Re: Static Sites on Heroku

#36

Earlier quoted context omitted.

Oh, I guess I could use GitHub hosting, but I wanted to host it on my own server. (I actually have a good reason to - I needed to access a WebSocket server on the same origin)

I think the big advantage for people wanting to host a site on Heroku is they explicitly DON'T need their "own server".

I don't see the advantage of that. For small static sites I don't think it's much more hassle to put CloudFlare in front of your server. The advantage of such services is scaling up dynamic sites easily.

Re: Static Sites on Heroku

#37

Heroku for a static site? Sounds like overkill. On my VPS I just do this: 1. Have public git repo, clone on server 2. Run nginx pointing to htdocs folder in git repo 3. When I want to deploy, ssh in and git pull Works just fine. Sure, it's a public site on GitHub, but I could just as easily run a git server.

I just git push to the server from my laptop over SSH. No need for a git server (or Github, for that matter).

I should really try that... thanks!

Edit: Oh wow, I didn't realise I could just do this:

  git push ssh://example.com/git/repo

Re: Static Sites on Heroku

#38

Earlier quoted context omitted.

I just git push to the server from my laptop over SSH. No need for a git server (or Github, for that matter).

I should really try that... thanks! Edit: Oh wow, I didn't realise I could just do this: git push ssh://example.com/git/repo

SSH is the transport you're using when you use github.

git@github.com:git/repo.git tells git to SSH using the 'git' user.

Re: Static Sites on Heroku

#40
post #23
post #18

There's an even easier way to do static sites on heroku and have them compiled for you - use stasis ( http://stasis.me ) - I've built a framework on top of stasis and have been using it for months, as part of very large production sites, and it's been extremely stable and super easy to use. All you need to do to get them working on heroku is include a super basic config.ru file, and you're all set. The files compile…

What's the difference in using nanoc to do that?

I am the creator of Stasis. Compare the sheer length of docs for nanoc (http://nanoc.stoneship.org/docs) to those of Stasis (http://stasis.me), and keep in mind that Stasis can do anything that Nanoc does.
Post reply on HN