app.rb + main handler