10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/rsodx/cli/commands/server.rb', line 10
def call(args)
env = args[:env]
port = args[:port]
ENV["RACK_ENV"] = env
rackup_path = File.expand_path("config.ru", Dir.pwd)
unless File.exist?(rackup_path)
abort "❌ config.ru not found in #{Dir.pwd}"
end
pid = spawn("bundle exec rackup --port=#{port} --host=0.0.0.0 #{rackup_path}")
puts "🚀 Rsodx started!"
Process.wait(pid)
rescue => e
abort "❌ Failed to start server: #{e.class} - #{e.message}"
end
|