Created
February 4, 2009 06:19
-
-
Save anonymous/57983 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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