Created
July 12, 2018 03:37
-
-
Save bchase/ac7092f920d62101849412c75fd584e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| PORT=${1:-8080} ruby server/sinatra.rb >/dev/null 2>/dev/null & | |
| PID=$! | |
| echo $PID > .pid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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