How to Restart Sinatra Automatically

Here is the solution that will save you time and nerves while working in Sinatra / Ruby. To reload Sinatra automatically, in the beginning of your document right after the opening

require 'sinatra'

add this:

require 'sinatra/reloader' if development?

You can now see changes by simply reloading page in your browser, no need to type anything in your terminal or Windows PowerShell to restart the server.