Sha256: d898f0286a81c4633e88a6eeda97d02bf4d815b7d6587504b0602efec0fbfc8f
Contents?: true
Size: 884 Bytes
Versions: 16
Compression:
Stored size: 884 Bytes
Contents
$:.unshift( "../lib" ) require 'capcode' module Capcode http_authentication( :type => :basic, :realm => "Private part", :routes => "/noauth/private" ) { { "greg" => "toto", "mu" => "maia" } } class Index < Route '/admin' def get # Basic HTTP Authentication http_authentication( :type => :basic, :realm => "Admin part" ) { { "greg" => "toto", "mu" => "maia" } } render "Success !" end end class Noauth < Route '/noauth' def get render "You don't need any special authorization here !" end end class Private < Route '/noauth/private' def get render "Welcome in the private part !" end end class Private2 < Route '/noauth/private/again' def get render "Welcome in the private/again part !" end end end Capcode.run( )
Version data entries
16 entries across 16 versions & 1 rubygems