Add the files described below and ensure that you do the following.
- Run bonsai --repot before you push to heroku (each time you push)
- Ensure that output/ is not .gitignored
- Make sure you pay Heroku. They're awesome.
| bonsai | |
| rdiscount |
| require 'website' | |
| run Bonsai::Server |
| require 'sinatra' | |
| require 'bonsai' | |
| Bonsai.root_dir = Dir.pwd | |
| module Bonsai | |
| class Server < Sinatra::Base | |
| enable :static | |
| disable :logging | |
| set :public, File.join(File.dirname(__FILE__), "output") | |
| get '/' do | |
| begin | |
| Page.find("index").render | |
| rescue Exception => e | |
| not_found | |
| end | |
| end | |
| get '/*' do | |
| begin | |
| Page.find(params[:splat].join).render | |
| rescue Exception => e | |
| not_found | |
| end | |
| end | |
| end | |
| end |