Skip to content

Instantly share code, notes, and snippets.

@antonsoroko antonsoroko/Gemfile
Last active Jul 20, 2019

Embed
What would you like to do?
ardo_app
require 'rubygems'
require 'sinatra'
# Unique identifier for the app's lifecycle.
# Useful for checking that an app doesn't die and come back up.
ID = SecureRandom.uuid
$stdout.sync = true
$stderr.sync = true
get '/' do
"Hello from #{ID}!"
end
get '/env' do
ENV.inspect
end
get '/sigterm' do
"Available sigterms #{`man -k signal | grep list`}"
end
get '/sigterm/:signal' do
pid = Process.pid
signal = params[:signal]
puts "Killing process #{pid} with signal #{signal}"
Process.kill(signal, pid)
end
get '/log/:bytes' do
system "cat /dev/zero | head -c #{params[:bytes].to_i}"
"Just wrote #{params[:bytes]} bytes of zeros to the log"
end
require "./app"
run Sinatra::Application
source "http://rubygems.org"
gem "sinatra"
GEM
remote: http://rubygems.org/
specs:
rack (1.5.1)
rack-protection (1.3.2)
rack
sinatra (1.3.4)
rack (~> 1.4)
rack-protection (~> 1.3)
tilt (~> 1.3, >= 1.3.3)
tilt (1.3.3)
PLATFORMS
ruby
DEPENDENCIES
sinatra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.