#!/usr/bin/env ruby require 'puma/cli' require 'simple_pvr' port = ENV['port'] || 4567 key = ENV['key'] cert = ENV['cert'] use_ssl = key && cert if use_ssl bind_url = "ssl://0.0.0.0:#{port}?key=#{key}&cert=#{cert}" else puts 'Consider setting up SSL by specifying key and cert. Please consult the documentation.' bind_url = "tcp://0.0.0.0:#{port}" end Puma::CLI.new([SimplePvr::PvrInitializer.rackup_file_path, '--bind', bind_url]).run