-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add API route for explore/code search #31515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f85c521
to
1232a01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch! I have provided some general feedback.
Whoops, did not mean to block this PR as my review is just general feedback. A maintainer with write access should be able to resolve this. |
853a39b
to
3eab528
Compare
@@ -890,6 +891,14 @@ func Routes() *web.Router { | |||
// Misc (public accessible) | |||
m.Group("", func() { | |||
m.Get("/version", misc.Version) | |||
m.Group("/explore", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the API route be /search/code to align with the naming conventions of the GitHub API?
m.Group("/explore", func() { | |
m.Group("/search", func() { |
Closes #31375
Creates an API endpoint at /explore/code to use the same code search from the web endpoint for /explore/code. This reuses as much code as possible from the web version without modifying behavior. New files have been added for the api route, return structs, and swagger.
Note for testing: You must set
REPO_INDEXER_ENABLED = true
in your app.ini config.