Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# config/environments/development.rb
Hello::Application.configure do
# ...
# https://rails.lighthouseapp.com/projects/8994/tickets/4676-reload-routes-on-each-request-in-dev-mode
service_reloader = ActiveSupport::FileUpdateChecker.new(Dir["app/services/**"]) { Rails.application.reload_routes! }
config.to_prepare do
service_reloader.execute_if_updated
end
end
# app/services/main_service.rb
require 'sinatra/base'
require 'sinatra/reloader'
class MainService < Sinatra::Base
configure :development do
register Sinatra::Reloader
end
get "/" do
"hi everybody!"
end
end
# config/routes.rb
Hello::Application.routes.draw do
mount MainService, at: "/api"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.