Created
March 5, 2012 07:15
-
-
Save daz4126/1977181 to your computer and use it in GitHub Desktop.
DAZ4126 add pages code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment