Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/discourse/files/discourse.fcgi

Issue 9422170: Run Discourse via Thin rather than FGCI (Closed)
Patch Set: Created Feb. 27, 2013, 1:34 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/ruby
2
3 require 'etc'
4
5 Dir.chdir(File.dirname(__FILE__))
6 ENV['RAILS_ENV'] ||= 'production'
7 ENV['GEM_HOME'] = "#{Etc.getpwuid.dir}/.gems"
8 ENV['GEM_PATH'] = "#{ENV['GEM_HOME']}:/var/lib/gems/1.9.1"
9
10 require 'fcgi'
11 require_relative 'config/environment'
12
13 class Rack::PathInfoRewriter
14 def initialize(app)
15 @app = app
16 end
17
18 def call(env)
19 env.delete('SCRIPT_NAME')
20 parts = env['REQUEST_URI'].split('?')
21 env['PATH_INFO'] = parts[0]
22 env['QUERY_STRING'] = parts[1].to_s
23 @app.call(env)
24 end
25 end
26
27 Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(Discourse::Application)
OLDNEW
« no previous file with comments | « no previous file | modules/discourse/files/init-discourse » ('j') | modules/discourse/files/intraforum.adblockplus.org » ('J')

Powered by Google App Engine
This is Rietveld