Sha256: 15e8995d9114225a70fc4b43cc6dc876ed62a99beb3af0ce6b2273f6100bca7d
Contents?: true
Size: 789 Bytes
Versions: 21
Compression:
Stored size: 789 Bytes
Contents
require 'sinatra' cat_image = File.open(File.join(File.dirname(__FILE__), 'cat.png'), 'rb').read get '/' do 'Ready!' end get '/plain_text' do status 200 headers \ 'Content-Type' => 'text/plain' body 'plain text' end get '/no_header' do status 200 headers \ 'Content-Type' => '' body 'no header' end get '/html' do status 200 headers \ 'Content-Type' => 'text/html; charset=utf-8' body '<body>' end get '/png' do status 200 headers \ 'Content-Type' => 'image/png' body cat_image end get '/404' do status 404 end get '/500' do status 500 end get '/last_modified' do status 200 headers \ 'Content-Type' => 'text/plain', 'Last-Modified' => 'Wed, 21 Oct 2015 07:28:00 GMT' body 'Look Ma, I have a Last-Modified header' end
Version data entries
21 entries across 21 versions & 1 rubygems