Ololo
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
class CoffeeAssets < Sinatra::Base
|
||||
set :views, File.expand_path('../../app/assets/javascripts', __FILE__)
|
||||
|
||||
get '/assets/:name.js' do
|
||||
path = "#{settings.views}/#{params[:name]}.coffee"
|
||||
return not_found unless File.exists?(path)
|
||||
|
||||
coffee params[:name].to_sym
|
||||
end
|
||||
end
|
||||
|
||||
class StylusAssets < Sinatra::Base
|
||||
set :views, File.expand_path('../../app/assets/stylesheets', __FILE__)
|
||||
|
||||
get '/assets/:name.css' do
|
||||
path = "#{settings.views}/#{params[:name]}.styl"
|
||||
return not_found unless File.exists?(path)
|
||||
|
||||
stylus params[:name].to_sym
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
class ErrorPages < Sinatra::Base
|
||||
set :views, File.expand_path('../../views', __FILE__)
|
||||
|
||||
not_found do
|
||||
status 404
|
||||
slim :error_404
|
||||
end
|
||||
|
||||
module Forbidden
|
||||
def forbidden
|
||||
status 403
|
||||
slim :error_403
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user