public
Created

DAZ4126 add pages code

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7 8 9
get '/:page' do
if File.exists?('views/'+params[:page]+'.slim')
slim params[:page].to_sym
elsif File.exists?('views/'+params[:page]+'.md')
markdown params[:page].to_sym
else
raise error(404)
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.