forked from namusyaka/react-sinatra-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.rb
More file actions
31 lines (24 loc) · 640 Bytes
/
app.rb
File metadata and controls
31 lines (24 loc) · 640 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
Bundler.require
register React::Sinatra
configure do
React::Sinatra.configure do |config|
config.use_bundled_react = true
config.env = :development
config.runtime = :execjs
config.asset_path = %w(client/dist/server.js)
config.pool_size = 5
config.pool_timeout = 10
end
React::Sinatra::Pool.pool.reset
end
set :views, File.join(__dir__, 'views')
set :public_folder, 'public'
get ?/ do
'this is an example for react-siantra'
end
get '/react-component' do
haml :'react-component', layout: true
end
get '/react-component-with-server' do
haml :'react-component-with-server', layout: true
end