Skip to content
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

Add default endpoint for REST server #5607

Closed
4 tasks
okwme opened this issue Feb 3, 2020 · 5 comments · Fixed by #5640
Closed
4 tasks

Add default endpoint for REST server #5607

okwme opened this issue Feb 3, 2020 · 5 comments · Fixed by #5640

Comments

@okwme
Copy link
Contributor

okwme commented Feb 3, 2020

Summary

The default endpoint for the Tendermint RPC shows all the available queries. This is also useful just to make sure the node is running (https://rpc.cosmos.network).

However, the default REST client shows a 404 (http://api.cosmos.network) and you need to go to /node_info or another GET request without parameters to check if it's online. It would be nice if we could offer a default endpoint that was more reassuring than a 404. Either some sort of "Hello World!" message or set the default route to be the same as /node_info?

Problem Definition

Proposal


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

ACK -- I would personally love to lay out all the endpoints like Tendermint does. Would this be something you'd be willing to look into and implement @okwme?

@okwme
Copy link
Contributor Author

okwme commented Feb 3, 2020

ja would be happy to look into it!

@okwme okwme self-assigned this Feb 3, 2020
@tac0turtle
Copy link
Member

on the Tendermint side, we want to move away from what we have now and if possible go to using the generated swagger. Here it may make sense to use the swagger for now, and then once we have auto-generate swagger files it would show only that

@okwme
Copy link
Contributor Author

okwme commented Feb 4, 2020 via email

@alexanderbez
Copy link
Contributor

alexanderbez commented Feb 4, 2020

Sure, that also works. In that case, just simply update this method:

func (rs *RestServer) registerSwaggerUI() {
	statikFS, err := fs.New()
	if err != nil {
		panic(err)
	}
	staticServer := http.FileServer(statikFS)
	rs.Mux.PathPrefix("/swagger-ui/").Handler(http.StripPrefix("/swagger-ui/", staticServer))
}

I suppose we should use / instead of /swagger-ui/

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

Successfully merging a pull request may close this issue.

3 participants