File tree Expand file tree Collapse file tree 1 file changed +25
-6
lines changed Expand file tree Collapse file tree 1 file changed +25
-6
lines changed Original file line number Diff line number Diff line change 5
5
puts "Starting Server..." . colorize ( :green )
6
6
rubyPort = 9292
7
7
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
8
28
else
9
29
workers Etc . nprocessors
10
30
before_fork do
13
33
rubyPort = 9292
14
34
cpuCount = Etc . nprocessors
15
35
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
16
41
end
17
42
end
18
43
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
-
25
44
preload_app!
26
45
port ENV [ 'PORT' ] || 9292
You can’t perform that action at this time.
0 commit comments