-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.ru
32 lines (25 loc) · 869 Bytes
/
config.ru
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
# This code is free software; you can redistribute it and/or modify it under
# the terms of the new BSD License.
#
# Copyright (c) 2015, Sebastian Staudt
require 'gallerist'
Gallerist.stdout << "\e]1;Starting Gallerist…\a" if Gallerist.stdout.tty?
warmup do |app|
error = []
Gallerist::App.enable :show_exceptions
Rack::MockRequest.new(app).get '/',
'rack.errors' => $stderr,
'rack.warmup' => true,
'rack.warmup.error' => error
Gallerist::App.disable :show_exceptions unless Gallerist::App.development?
raise error.first unless error.empty?
Rack::MockRequest.new(app).get '/assets/main.css'
Rack::MockRequest.new(app).get '/assets/main.js'
if Gallerist.stdout.tty?
Gallerist.stdout << "\e]1;Gallerist (listening on #{Gallerist.options[:port]})\a"
end
end
map '/assets' do
run Gallerist::App.sprockets
end
run Gallerist::App