Skip to content

Instantly share code, notes, and snippets.

@turhn
Last active March 12, 2016 23:23
Show Gist options
  • Save turhn/00e1460a746bbf982385 to your computer and use it in GitHub Desktop.
Save turhn/00e1460a746bbf982385 to your computer and use it in GitHub Desktop.
Sinatra Application, serve static index.html using nginx
server {
# ...nginx stuff
index index.html;
# ...more nginx stuff
}
require 'sinatra/base'
class SinatraApplication < Sinatra::Base
if ENV['RACK_ENV'] == 'development'
get '/' do
File.read(File.join('public', 'index.html'))
end
end
post '/handle_form' do
# Handle parameters
end
get '/products' do
haml :products
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment