mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-22 11:47:42 +00:00
add bugsnag test endpoint
This commit is contained in:
parent
7e36609cda
commit
451a1a96fb
1 changed files with 10 additions and 0 deletions
|
@ -107,11 +107,21 @@ func (a *api) Routes() *mux.Router {
|
||||||
r.HandleFunc("/v1/receipt", a.checkReceiptHandler).Methods("POST")
|
r.HandleFunc("/v1/receipt", a.checkReceiptHandler).Methods("POST")
|
||||||
r.HandleFunc("/v1/receipt/{apns}", a.checkReceiptHandler).Methods("POST")
|
r.HandleFunc("/v1/receipt/{apns}", a.checkReceiptHandler).Methods("POST")
|
||||||
|
|
||||||
|
r.HandleFunc("/v1/test/bugsnag", a.testBugsnagHandler).Methods("POST")
|
||||||
|
|
||||||
r.Use(a.loggingMiddleware)
|
r.Use(a.loggingMiddleware)
|
||||||
|
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *api) testBugsnagHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if err := bugsnag.Notify(fmt.Errorf("Test error")); err != nil {
|
||||||
|
a.errorResponse(w, r, 500, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
}
|
||||||
|
|
||||||
type LoggingResponseWriter struct {
|
type LoggingResponseWriter struct {
|
||||||
w http.ResponseWriter
|
w http.ResponseWriter
|
||||||
statusCode int
|
statusCode int
|
||||||
|
|
Loading…
Reference in a new issue