summaryrefslogtreecommitdiff
path: root/lib/dashing.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dashing.rb')
-rw-r--r--lib/dashing.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/dashing.rb b/lib/dashing.rb
index 04e4cee..bae4c29 100644
--- a/lib/dashing.rb
+++ b/lib/dashing.rb
@@ -49,7 +49,11 @@ end
get '/:dashboard' do
protected!
- erb params[:dashboard].to_sym
+ if File.exist? File.join(settings.views, "#{params[:dashboard]}.erb")
+ erb params[:dashboard].to_sym
+ else
+ halt 404
+ end
end
get '/views/:widget?.html' do
@@ -71,6 +75,10 @@ post '/widgets/:id' do
end
end
+not_found do
+ send_file File.join(settings.public_folder, '404.html')
+end
+
def development?
ENV['RACK_ENV'] == 'development'
end