File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 puts "Starting Server..." . colorize ( :green )
66 rubyPort = 9292
77 rubyPort = ARGV [ ARGV . index ( '-p' ) + 1 ] || ARGV [ ARGV . index ( '--port' ) + 1 ] if ARGV . include? ( '-p' ) || ARGV . include? ( '--port' )
8+ if ENV [ 'RACK_ENV' ] == 'production'
9+ system ( "node node-server/server.js --ruby-port=#{ rubyPort } --node-port=9293 &" )
10+ else
11+ system ( "node node-server/server-dev.js --ruby-port=#{ rubyPort } --node-port=9293 &" )
12+ end
13+ elsif ENV [ 'SP' ] == 'true'
14+ workers 1
15+ before_fork do
16+ puts "Single Process Mode" . colorize ( :red )
17+ puts "Master Process ID: #{ Process . pid } " . colorize ( :green )
18+ puts "Starting Server..." . colorize ( :green )
19+ rubyPort = 9292
20+ cpuCount = Etc . nprocessors
21+ rubyPort = ARGV [ ARGV . index ( '-p' ) + 1 ] || ARGV [ ARGV . index ( '--port' ) + 1 ] if ARGV . include? ( '-p' ) || ARGV . include? ( '--port' )
22+ if ENV [ 'RACK_ENV' ] == 'production'
23+ system ( "node node-server/server.js --ruby-port=#{ rubyPort } --node-port=9293 &" )
24+ else
25+ system ( "node node-server/server-dev.js --ruby-port=#{ rubyPort } --node-port=9293 &" )
26+ end
27+ end
828else
929 workers Etc . nprocessors
1030 before_fork do
1333 rubyPort = 9292
1434 cpuCount = Etc . nprocessors
1535 rubyPort = ARGV [ ARGV . index ( '-p' ) + 1 ] || ARGV [ ARGV . index ( '--port' ) + 1 ] if ARGV . include? ( '-p' ) || ARGV . include? ( '--port' )
36+ if ENV [ 'RACK_ENV' ] == 'production'
37+ system ( "node node-server/server.js --ruby-port=#{ rubyPort } --node-port=9293 &" )
38+ else
39+ system ( "node node-server/server-dev.js --ruby-port=#{ rubyPort } --node-port=9293 &" )
40+ end
1641 end
1742end
1843
19- if ENV [ 'RACK_ENV' ] == 'production'
20- system ( "node node-server/server.js --ruby-port=#{ rubyPort } --node-port=9293 &" )
21- else
22- system ( "node node-server/server-dev.js --ruby-port=#{ rubyPort } --node-port=9293 &" )
23- end
24-
2544preload_app!
2645port ENV [ 'PORT' ] || 9292
You can’t perform that action at this time.
0 commit comments