Last active
March 12, 2016 23:23
-
-
Save turhn/00e1460a746bbf982385 to your computer and use it in GitHub Desktop.
Sinatra Application, serve static index.html using nginx
This file contains 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
server { | |
# ...nginx stuff | |
index index.html; | |
# ...more nginx stuff | |
} |
This file contains 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
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