diff options
author | Daniel Beauchamp <daniel.beauchamp@shopify.com> | 2012-10-30 11:45:12 -0400 |
---|---|---|
committer | Daniel Beauchamp <daniel.beauchamp@shopify.com> | 2012-10-30 11:45:12 -0400 |
commit | 76cf77a89a17dd12299a6f4b63c967163ceae39a (patch) | |
tree | 9c9d54c05470da7ef937e1c0b681440d61910b5e | |
parent | a4a4564f760bb1bcd541366186cd46488d5a569b (diff) |
Make the default port 3030
-rwxr-xr-x | bin/dashing | 5 | ||||
-rw-r--r-- | templates/project/dashboards/sample.erb | 2 | ||||
-rw-r--r-- | templates/project/dashboards/sampletv.erb | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/bin/dashing b/bin/dashing index e363ee2..fb1332f 100755 --- a/bin/dashing +++ b/bin/dashing @@ -14,7 +14,7 @@ def send_event(id, data) req = Net::HTTP::Post.new("/widgets/#{id}") req["content-type"] = "application/json" req.body = JSON.unparse(data.merge(:auth_token => Dashing::CLI.auth_token)) - res = Net::HTTP.new('localhost', 3000).start { |http| http.request(req) } + res = Net::HTTP.new('localhost', 3030).start { |http| http.request(req) } puts "Data Sent to #{id}: #{data}" end @@ -61,8 +61,9 @@ module Dashing desc "start", "Starts the server in style!" method_option :job_path, :desc => "Specify the directory where jobs are stored" def start(*args) + port_option = args.include?('-p')? '' : ' -p 3030' args = args.join(" ") - command = "bundle exec thin -R config.ru start #{args}" + command = "bundle exec thin -R config.ru start #{port_option} #{args}" command.prepend "export JOB_PATH=#{options[:job_path]}; " if options[:job_path] system(command) end diff --git a/templates/project/dashboards/sample.erb b/templates/project/dashboards/sample.erb index ab5cb00..7435b56 100644 --- a/templates/project/dashboards/sample.erb +++ b/templates/project/dashboards/sample.erb @@ -21,5 +21,5 @@ <div data-id="convergence" data-view="Graph" data-title="Convergence" style="background-color:#ff9618"></div> </li> </ul> - <center><div style="font-size: 12px">Try this: curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "text": "Hey, Look what I can do!" }' \http://localhost:3000/widgets/welcome</div></center> + <center><div style="font-size: 12px">Try this: curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "text": "Hey, Look what I can do!" }' \http://<%=request.host%>:<%=request.port%>/widgets/welcome</div></center> </div>
\ No newline at end of file diff --git a/templates/project/dashboards/sampletv.erb b/templates/project/dashboards/sampletv.erb index b52eed7..7ac9112 100644 --- a/templates/project/dashboards/sampletv.erb +++ b/templates/project/dashboards/sampletv.erb @@ -52,5 +52,5 @@ $(function() { </li> </ul> - <center><div style="font-size: 12px">Try this: curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "text": "Hey, Look what I can do!" }' \http://localhost:3000/widgets/welcome</div></center> + <center><div style="font-size: 12px">Try this: curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "text": "Hey, Look what I can do!" }' \http://<%=request.host%>:<%=request.port%>/widgets/welcome</div></center> </div>
\ No newline at end of file |