-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdevkit.ru
More file actions
40 lines (35 loc) · 921 Bytes
/
devkit.ru
File metadata and controls
40 lines (35 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'coffee-script'
require 'sprockets'
require 'rack/cors'
project_root = File.expand_path(File.dirname(__FILE__))
###
# Allow CORS GET requests for anything
###
use Rack::Cors do
allow do
origins '*'
resource '*', :headers => :any, :methods => :get
end
end
###
# Sprockets for /devkit
# responsible for serving development versions of /devkit/kanbantool-devkit.css and /devkit/kanbantool-devkit.js
###
assets = Sprockets::Environment.new(project_root) do |env|
env.logger = Logger.new(STDOUT)
env.append_path(File.join(project_root, 'devkit'))
env.context_class.class_eval do
def asset_path(path, options = {})
File.join('http://localhost:9292/devkit', path)
end
end
end
map '/devkit' do
run assets
end
map '/' do
# use Rack::AppendTrailingSlash
use Rack::Static,
:urls => ['/'], :root => File.expand_path('doc/_site'), :index => 'index.html'
run lambda {|*|}
end