mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Move all web stuff into /web, fix trailing slash issue.
This commit is contained in:
parent
5ea0ca89d0
commit
20e51f1276
23 changed files with 6 additions and 2 deletions
|
@ -18,6 +18,10 @@ module Sidekiq
|
|||
end
|
||||
|
||||
def call(env)
|
||||
# Solve the problem of people requesting /sidekiq when they need to request /sidekiq/ so
|
||||
# that relative links in templates resolve correctly.
|
||||
return [301, { 'Location' => "#{env['SCRIPT_NAME']}/" }, []] if env['SCRIPT_NAME'] == env['REQUEST_PATH']
|
||||
|
||||
return @app.call(env) unless @matcher =~ env["PATH_INFO"]
|
||||
env['PATH_INFO'].sub!(@matcher,'')
|
||||
@environment.call(env)
|
||||
|
@ -25,10 +29,10 @@ module Sidekiq
|
|||
end
|
||||
|
||||
class Web < Sinatra::Base
|
||||
dir = File.expand_path(File.dirname(__FILE__) + "/../..")
|
||||
dir = File.expand_path(File.dirname(__FILE__) + "/../../web")
|
||||
set :views, "#{dir}/views"
|
||||
set :root, "#{dir}/public"
|
||||
use SprocketsMiddleware, :root => dir, :path => 'assets'
|
||||
use SprocketsMiddleware, :root => dir
|
||||
|
||||
get "/" do
|
||||
slim :index
|
||||
|
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Loading…
Reference in a new issue