forked from lucasefe/rubyconfar-2012
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.rb
46 lines (34 loc) · 1012 Bytes
/
app.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# encoding: utf-8
require './config/shotgun'
Cuba.use Rack::MethodOverride
Cuba.use Rack::Session::Cookie,
key: "rubyconfar",
secret: "jhaksfgsdkgaskjfgskdfgsk"
require "rack/protection"
Cuba.use Rack::Protection
Cuba.use Rack::Protection::RemoteReferrer
Cuba.use Rack::Static,
root: "public",
urls: ["/javascripts", "/images"]
Cuba.plugin Cuba::TextHelpers
Cuba.plugin Cuba::Render
require './lib/cuba-r18n'
Cuba.plugin Cuba::R18n
# ADMIN
require "./routes/public"
require "./models/video"
require "./models/promotional_video"
require "./models/user"
require "./models/speaker"
require "./models/subscriber"
require "./models/proposal"
Cuba.define do
on "stylesheets", extension("css") do |file|
res.headers["Cache-Control"] = "public, max-age=29030400" if req.query_string =~ /[0-9]{10}/
res.headers["Content-Type"] = "text/css; charset=utf-8"
res.write render("views/stylesheets/#{file}.sass", {}, load_paths: SASS_LOAD_PATHS )
end
on default do
run Public
end
end