Skip to content

Instantly share code, notes, and snippets.

Created February 4, 2009 06:19
Show Gist options
  • Save anonymous/57983 to your computer and use it in GitHub Desktop.
Save anonymous/57983 to your computer and use it in GitHub Desktop.
require File.dirname(__FILE__) + '/lib/openlinuxrouter'
require 'rubygems'
require 'sinatra'
require 'activerecord'
enable :sessions
set :environment, :development
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:dbfile => 'db/openlinuxrouter.db'
)
#load modules
Dir.foreach('./modules/') do |entry|
if File.exist?('./modules/' + entry + '/module.rb')
run './modules/' + entry + '/module.rb'
end
if File.exist?('./modules/' + entry + '/migrations.rb')
end
end
#configuration
configure :development do
end
configure :test do
end
configure :production do
end
#setup authentication verification
before do
#redirect '/login/' unless session[:user]
end
#setup 404
not_found do
status 404
end
#setup errors
error do
"<em>#{request.env['sinatra.error']}</em>"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment