Conversation
brandon-rhodes
left a comment
There was a problem hiding this comment.
I just ran across this pull request and realized that I made a comment but then failed to hit "Submit" in GitHub's new 2-phase review process, so you never saw my comment!
Overall, I'm not sure this is desirable; google.com, for example, simply shows a 404 if I access google.com/foo. I think that successfully registering code.pp as a search engine would accomplish the same ease of use from the browser address bar, but without polluting the top-level URL namespace?
|
|
||
| m.Add("GET", "/api/v1/search/:backend", srv.Handler(srv.ServeAPISearch)) | ||
| m.Add("GET", "/api/v1/search/", srv.Handler(srv.ServeAPISearch)) | ||
| m.Add("GET", "/:query/", srv.Handler(srv.ServeFastSearch)) |
There was a problem hiding this comment.
The whitespace here looks odd — configure your editor to run gofmt each time you hit Save.
|
kzihong seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
added a new endpoint that allows quick querying from the address bar
if a top level get request ending in a / does not match any endpoint it automatically makes a search instead. most browsers also support spaces
e.g. code/hello world/ searches "hello world"