Skip to content
Snippets Groups Projects
Commit e811354c authored by Tyler Lemburg's avatar Tyler Lemburg
Browse files

Server up, app file

parent fd00b922
No related branches found
No related tags found
No related merge requests found
app.rb 0 → 100644
require 'sinatra'
use Rack::Session::Cookie, :key => 'rack.session',
:path => '/',
:domain => (ENV['RACK_ENV'] == 'development' ? nil : 'resource.unl.edu'),
:secret => '420terrace12qmemorialpinnaclehawks',
:old_secret => '420terrace12qmemorialpinnaclehawks'
Time.zone = "America/Chicago"
# this gives the user messages
def flash(type, header, message)
session["notice"] ||= []
session["notice"] << {
:type => type,
:header => header,
:message => message
}
end
before do
# site defaults
@title = 'UNL Resource Scheduler'
@breadcrumbs = [
{
:href => 'http://www.unl.edu/',
:text => 'UNL',
:title => 'University of Nebraska&ndash;Lincoln'
},
{
:href => '/',
:text => 'UNL Resource Scheduler'
}
]
session[:init] = true
end
get '/' do
@breadcrumbs << {:text => 'Home'}
'Home'
end
\ No newline at end of file
require './utils/language'
ENV['RACK_ENV'] ||= 'development'
# load the config file
require './utils/config_loader'
# set up the database connection
require 'utils/database'
# get sinatra and the app
require 'sinatra'
require 'app'
if ENV['RACK_ENV'] == 'development'
# weird workaround for localhost cookie things
set :cookie_options, :domain => nil
else
set :cookie_options, :domain => 'resource.unl.edu'
end
# run it
run Sinatra::Application
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment