Module: Lowkiq::Web
- Defined in:
- lib/lowkiq/web.rb,
lib/lowkiq/web/api.rb,
lib/lowkiq/web/action.rb
Defined Under Namespace
Modules: Api
Classes: Action
Constant Summary
collapse
- HTML =
Proc.new do |env|
root_path = env['SCRIPT_NAME']
[200, {}, [<<-HTML]]
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Lowkiq</title>
</head>
<body>
<div id="root"></div>
<script type="text/javascript">
window.lowkiqRoot="#{root_path}";
</script>
<script type="text/javascript" src="#{root_path}/assets/#{VERSION}/app.js"></script>
</body>
</html>
HTML
end
- ASSETS =
File.expand_path("#{File.dirname(__FILE__)}/../../assets")
- APP =
Rack::Builder.new do
map "/api" do
run Api
end
map "/assets/#{VERSION}" do
run Rack::File.new ASSETS, { 'Cache-Control' => 'public, max-age=86400' }
end
run HTML
end
Class Method Summary
collapse
Class Method Details
.call(env) ⇒ Object
41
42
43
|
# File 'lib/lowkiq/web.rb', line 41
def self.call(env)
APP.call env
end
|