Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apis/server/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func initRoute(s *Server) http.Handler {

// metrics
r.Path(versionMatcher + "/metrics").Methods(http.MethodGet).Handler(prometheus.Handler())
r.Path("/metrics").Methods(http.MethodGet).Handler(prometheus.Handler())

if s.Config.Debug {
profilerSetup(r)
Expand All @@ -83,6 +84,7 @@ func initRoute(s *Server) http.Handler {

func addRoute(r *mux.Router, mothod string, path string, f func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error) {
r.Path(versionMatcher + path).Methods(mothod).Handler(filter(f))
r.Path(path).Methods(mothod).Handler(filter(f))
}

func profilerSetup(mainRouter *mux.Router) {
Expand Down
3 changes: 2 additions & 1 deletion test/api_version_parameter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func (suite *APIVersionSuite) SetUpTest(c *check.C) {
}

// TestNoVersionParamsInURL test api url not contains version info.
// Pouch api url support with or without version info.
func (suite *APIVersionSuite) TestNoVersionParamsInURL(c *check.C) {
cname := "TestCreateURLNoVersionInfo"

Expand Down Expand Up @@ -55,5 +56,5 @@ func (suite *APIVersionSuite) TestNoVersionParamsInURL(c *check.C) {
resp, err := apiClient.HTTPCli.Do(req)
c.Assert(err, check.IsNil)

CheckRespStatus(c, resp, 404)
CheckRespStatus(c, resp, 201)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is already an API integration test for the target.

}