diff --git a/lib/diversipub/rack_app.rb b/lib/diversipub/rack_app.rb index 6329edc..53ff43c 100644 --- a/lib/diversipub/rack_app.rb +++ b/lib/diversipub/rack_app.rb @@ -21,8 +21,18 @@ module Diversipub def builder @builder ||= Rack::Builder.new.tap do |builder| + builder.use Rack::Static, **rack_static_kwargs builder.run @sinatra_app end end + + def rack_static_kwargs + @rack_static_kwargs ||= { + cascade: true, + index: 'index.html', + root: File.expand_path('../website/build').freeze, + urls: [''].freeze, + }.freeze + end end end diff --git a/lib/diversipub/sinatra_app.rb b/lib/diversipub/sinatra_app.rb index 886186e..de51e93 100644 --- a/lib/diversipub/sinatra_app.rb +++ b/lib/diversipub/sinatra_app.rb @@ -20,8 +20,8 @@ module Diversipub alias new new! end - get '/' do - 'Hello, World!' + get '/index.html' do + redirect 'ru/index.html' end end end