mirror of
				https://github.com/sinatra/sinatra
				synced 2023-03-27 23:18:01 -04:00 
			
		
		
		
	Turn sessions on or off
This commit is contained in:
		
							parent
							
								
									c333cdb8bf
								
							
						
					
					
						commit
						01061464e0
					
				
					 4 changed files with 38 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -1,9 +1,13 @@
 | 
			
		|||
$LOAD_PATH.unshift File.dirname(__FILE__) + '/../../lib'
 | 
			
		||||
require 'sinatra'
 | 
			
		||||
 | 
			
		||||
# get '/' do
 | 
			
		||||
#   "Hello World!"
 | 
			
		||||
# end
 | 
			
		||||
production do
 | 
			
		||||
  sessions :off
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
get '/' do
 | 
			
		||||
  "Hello World!"
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
get '/erb.xml' do
 | 
			
		||||
  header 'Content-Type' => 'application/xml'
 | 
			
		||||
| 
						 | 
				
			
			@ -18,3 +22,9 @@ get '/erb2' do
 | 
			
		|||
  erb 'Hello <%= params[:name].capitalize || "World" %> 2!'
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
# Custom 404
 | 
			
		||||
 | 
			
		||||
get 404 do
 | 
			
		||||
  'Custom 404!!!!'
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue