Skip to content

Instantly share code, notes, and snippets.

@bchase
Created July 12, 2018 03:37
Show Gist options
  • Select an option

  • Save bchase/ac7092f920d62101849412c75fd584e3 to your computer and use it in GitHub Desktop.

Select an option

Save bchase/ac7092f920d62101849412c75fd584e3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'sinatra'
set :port, ENV['PORT'] || 8080
get '*/elm.js' do |_|
send_file 'dist/elm.js'
end
get '*' do |_|
send_file 'dist/index.html'
end
#!/usr/bin/env sh
PORT=${1:-8080} ruby server/sinatra.rb >/dev/null 2>/dev/null &
PID=$!
echo $PID > .pid
#!/usr/bin/env sh
kill `cat .pid`
rm .pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment