toppage.rb 591 B

1234567891011121314151617181920212223242526
  1. # frozen_string_literal: true
  2. require 'sinatra'
  3. require 'sinatra/base'
  4. require 'sinatra/contrib'
  5. # Display the Top level Web page
  6. class Toppage < Sinatra::Base
  7. register Sinatra::RespondWith
  8. set :public_folder, File.join(File.dirname(__FILE__), '..', '/static')
  9. set :views, File.join(File.dirname(__FILE__), '..', '/views')
  10. # just respond with OK, so that monitoring knows that the application is running
  11. get '/monitor' do
  12. 'OK'
  13. end
  14. get '/' do
  15. respond_to do |wants|
  16. wants.html do
  17. erb :index,
  18. layout: :base_layout
  19. end
  20. end
  21. end
  22. end