forked from gomods/athens
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove Buffalo * gofmt * pr fixes * fix subrouter * bring back secure middleware + pr fixes * better place for subrouter * vendor
- Loading branch information
1 parent
36aba59
commit 5870aee
Showing
1,129 changed files
with
461 additions
and
371,404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,8 +18,6 @@ tmp/* | |
vgp | ||
bin/* | ||
.envrc | ||
athens | ||
yarn-error.log | ||
cmd/proxy/proxy | ||
test-keys.json | ||
tmp | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
package actions | ||
|
||
import ( | ||
"github.com/gobuffalo/buffalo" | ||
"net/http" | ||
) | ||
|
||
func healthHandler(c buffalo.Context) error { | ||
return c.Render(http.StatusOK, nil) | ||
func healthHandler(w http.ResponseWriter, r *http.Request) { | ||
w.WriteHeader(http.StatusOK) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
package actions | ||
|
||
import ( | ||
"github.com/gobuffalo/buffalo" | ||
"net/http" | ||
) | ||
|
||
func proxyHomeHandler(c buffalo.Context) error { | ||
return c.Render(http.StatusOK, proxy.JSON("Welcome to The Athens Proxy")) | ||
func proxyHomeHandler(w http.ResponseWriter, r *http.Request) { | ||
w.Write([]byte(`"Welcome to The Athens Proxy"`)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
package actions | ||
|
||
import ( | ||
"github.com/gobuffalo/buffalo" | ||
"github.com/gomods/athens/pkg/storage" | ||
"net/http" | ||
|
||
"github.com/gomods/athens/pkg/storage" | ||
) | ||
|
||
func getReadinessHandler(s storage.Backend) buffalo.Handler { | ||
return func(c buffalo.Context) error { | ||
if _, err := s.List(c, "github.com/gomods/athens"); err != nil { | ||
return c.Render(http.StatusInternalServerError, nil) | ||
func getReadinessHandler(s storage.Backend) http.HandlerFunc { | ||
return func(w http.ResponseWriter, r *http.Request) { | ||
if _, err := s.List(r.Context(), "github.com/gomods/athens"); err != nil { | ||
w.WriteHeader(http.StatusInternalServerError) | ||
} | ||
|
||
return c.Render(http.StatusOK, nil) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package actions | ||
|
||
import ( | ||
"github.com/gobuffalo/buffalo" | ||
"github.com/gomods/athens/pkg/build" | ||
"encoding/json" | ||
"net/http" | ||
|
||
"github.com/gomods/athens/pkg/build" | ||
) | ||
|
||
func versionHandler(c buffalo.Context) error { | ||
return c.Render(http.StatusOK, proxy.JSON(build.Data())) | ||
func versionHandler(w http.ResponseWriter, r *http.Request) { | ||
json.NewEncoder(w).Encode(build.Data()) | ||
} |
Oops, something went wrong.