Sha256: ec6ac27c95d5baf8a48f7b707fd3d4530235b064ac86c0c989f9f090d995e551
Contents?: true
Size: 976 Bytes
Versions: 1
Compression:
Stored size: 976 Bytes
Contents
#!/usr/bin/env ruby require 'colorize' require 'optparse' class RoutingError < StandardError; end begin OptionParser.new do |opts| opts.banner = "Usage: nephos-server [-p=port] [--debug]" $server_port = ENV["SERVER_PORT"] || 8080 opts.on("-p=nb", "--port=nb", "Port") do |port| $server_port = Integer(port) end opts.on("--debug") do $debug = true end end.parse! if $debug require_relative "../lib/nephos-server" else require 'nephos-server' end if not $debug and (not File.exists? "Gemfile.lock" or not File.read("Gemfile.lock").split.index("nephos-server")) raise InvalidApplication end puts "Running Nephos::Server version #{Nephos::VERSION}" Nephos::Server.start($server_port) rescue RoutingError => err puts "Routing Error: Check out the documentation and `routes.rb` file.".yellow puts "#{err.class}: #{err.message}".red rescue => err puts "#{err.class}: #{err.message}".red end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
nephos-server-0.4.5 | bin/nephos-server |