Skip to content

Comments

added a new endpoint that allows quick querying from the address bar#11

Open
hihellohi wants to merge 1 commit intomasterfrom
fastquery
Open

added a new endpoint that allows quick querying from the address bar#11
hihellohi wants to merge 1 commit intomasterfrom
fastquery

Conversation

@hihellohi
Copy link

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"

@hihellohi hihellohi self-assigned this Jul 19, 2018
@hihellohi hihellohi requested a review from brandon-rhodes July 19, 2018 22:13
Copy link

@brandon-rhodes brandon-rhodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whitespace here looks odd — configure your editor to run gofmt each time you hit Save.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants