jlong / serve

Serve is a small Rack-based web server and rapid prototyping framework for Web applications (specifically Rails apps). Serve is meant to be a lightweight version of the Views part of the Rails MVC. This makes Serve an ideal framework for prototyping Rails applications or creating simple websites. Serve has full support for Rails-style partials and layouts.
http://get-serve.com
Other
836 stars 90 forks source link

Should print URL when booting #107

Closed topfunky closed 9 years ago

topfunky commented 10 years ago

On Mac OS X and other OSes, URLs in the terminal can be right clicked and opened in the browser.

Serve would be more useful if it printed the URL that it's serving on after it boots. For example:

Serving at http://localhost:4000
ntalbott commented 10 years ago

How did I not know about clickable terminal urls? This changes everything.

jlong commented 10 years ago

I like this idea. A pull request would be welcome.

wazery commented 9 years ago

I think their is no need for a PR, I can open the link on with my OS X Terminal with these shortcuts:

Before OS X Lion:

cmd+shift+double-click on a URL in Terminal.app and it will open in the default browser.

OS X >= Lion:

cmd+double-click (otherwise you will enter fullscreen mode).

Hope these help!

topfunky commented 9 years ago

@wazery I believe the issue was that serve originally did not print any URL at all, so there was nothing that could be single clicked, double clicked, cmd+shift+triple-clicked with your right foot in and your right foot out, or any other way.

wazery commented 9 years ago

Good that they added URLs, so this issue can be closed now, right?

topfunky commented 9 years ago

I just tried with 1.5.2 and there's still no URL.

Install Mongrel or Thin for better performance.
[2015-04-02 18:28:36] INFO  WEBrick 1.3.1
[2015-04-02 18:28:36] INFO  ruby 2.0.0 (2014-05-08) [universal.x86_64-darwin13]
[2015-04-02 18:28:36] INFO  WEBrick::HTTPServer#start: pid=60526 port=4000
^C[2015-04-02 18:29:08] INFO  going to shutdown ...
[2015-04-02 18:29:08] INFO  WEBrick::HTTPServer#start done.
wazery commented 9 years ago

Oh, then I will create a PR and reference this issue.

wazery commented 9 years ago

After reading into lib/serve/application.rb, I found both #277 and #284 lines are printing the URL for only Thin or Mongrel servers. From your log apparently you are using WEBrick, so I am thinking of adding a URL to it also, @jlong WDYT?

jlong commented 9 years ago

Merged! Thank you! This will be in the next release.

wazery commented 9 years ago

Cool, thanks.

jlong commented 9 years ago

Also made you a colaborator. If there is anything else you'd like to tidy up, please do!

wazery commented 9 years ago

Awesome, thanks for that, I will investigate in the issues and contribute more :smiley: