File: config.ru

package info (click to toggle)
ruby-task-list 2.0.0-2~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 248 kB
  • sloc: ruby: 319; sh: 14; makefile: 6
file content (30 lines) | stat: -rw-r--r-- 594 bytes parent folder | download | duplicates (4)
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
# Rack environment for testing purposes

require 'coffee-script'
require 'json'
require 'sprockets'

Root = File.expand_path("..", __FILE__)

Assets = Sprockets::Environment.new(Root) do |env|
  env.append_path "bower_components"
  env.append_path "app/assets/javascripts"
  env.append_path "app/assets/stylesheets"
  env.append_path "test"
end

map "/assets" do
  run Assets
end

map "/update" do
  run lambda { |env|
    sleep 0.5
    req = Rack::Request.new(env)
    [200, {'Content-Type' => 'application/json'}, [req.params.to_json]]
  }
end

map "/" do
  run Rack::Directory.new(Root)
end