scratch/content/html/en/blog/2010-08-23-Now-heberged-on-heroku.md
Yann Esposito (Yogsototh) 7b5cfbf3e0 Updated content
2010-08-23 15:34:35 +02:00

1.3 KiB

isHidden menupriority kind created_at title subtitle author_name author_uri tags
false 1 article 2010-08-23T15:05:13+02:00 Now heberged on heroku Heberge static website on Heroku Yann Esposito yannesposito.com
blog

Now on Heroku

I now changed my hosting to Heroku. I believe it will be far more reliable.

But as you should know my website is completely static. I use nanoc to generate it. But here is the conf to make it work on heroku.

The root of my files is /output. You only need to create a config.ru file:

require 'rubygems' require 'rack' require 'rack-rewrite'

use Rack::Rewrite do rewrite %r{(.*)/$},"$1/index.html" end use Rack::Static, :urls => ["/"], :root => "output" app = lambda { |env| [404, { 'Content-Type' => 'text/html' }, 'File Not Found'] } run app

and the .gems file needed to install rack middlewares.

rack rack-rewrite

Now, just follow the heroku tutorial to create an application :

git init git add . heroku create git push heroku master

Now I'll should be able to redirect properly to my own 404 page for example. I hope it is helpful.