Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 69 lines (58 sloc) 1.6 KB
#!/usr/bin/env rackup
# encoding: utf-8
#\ -E deployment
# load paths relative to document root
$: << ::File.dirname(__FILE__)
# load config file
require 'yaml'
$config = YAML::load_file('config.yaml')
require 'rack/auth/digest/md5'
require 'rack/accept_media_types'
#require 'rack/supported_media_types'
require 'lib/path_info_fix'
require 'lib/subdirectory_routing'
require 'lib/util'
require 'http_router'
use Rack::Reloader
use Rack::ContentLength
use Rack::ShowExceptions
use PathInfoFix
use Rack::Static, :urls => ['/stylesheets'] # Serve static files if no real server is present
use SubdirectoryRouting, $config['subdirectory'].to_s
#use Rack::SupportedMediaTypes, ['application/xhtml+xml', 'text/html', 'text/plain']
run {
get('/?') { |env|
require 'controllers/index'
get('/search/?') { |env|
require 'controllers/search'
get('/edit/?') { |env|
with_auth(env) {|env|
require 'controllers/edit'
post('/edit/?').to { |env|
with_auth(env) {
require 'controllers/edit'
get('/add/?') { |env|
# Digest auth is currently broken for query strings
# So, whatever, the search results are public, just protect the save endpoint
# with_auth(env) {
require 'controllers/add'
# }
post('/add/?').to { |env|
# Auth requirement is inside, only if not a recommendation
require 'controllers/add'
Jump to Line
Something went wrong with that request. Please try again.