Skip to content

Instantly share code, notes, and snippets.

@kenichi
Created August 10, 2017 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenichi/91052e53a170576476b922be7764abde to your computer and use it in GitHub Desktop.
Save kenichi/91052e53a170576476b922be7764abde to your computer and use it in GitHub Desktop.
require 'sinatra/base'
class App < Sinatra::Base
get '/' do
"hello!\n"
end
post '/exit' do
Thread.new { sleep 1; exit }
"exiting!\n"
end
end
at_exit do
puts 'here in at_exit 1'
end
at_exit do
puts 'here in at_exit 2'
end
at_exit do
puts 'here in at_exit 3'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment