Created
May 10, 2021 15:18
-
-
Save LautaroJayat/4a4d0f5593851208f354ebeb7fd67c1f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package Router | |
import ( | |
"fmt" | |
"net/http/httputil" | |
"github.com/julienschmidt/httprouter" | |
s "github.com/lautarojayat/auth_proxy/proxy/strategy" | |
) | |
func NewRouter(rp *httputil.ReverseProxy) (*httprouter.Router){ | |
r:= httprouter.New() | |
r.GET("/*path", s.CheckAuthHeader(rp) ) | |
r.POST("/*path", s.CheckAuthHeader(rp)) | |
r.DELETE("/*path", s.CheckAuthHeader(rp)) | |
r.PUT("/*path", s.CheckAuthHeader(rp)) | |
r.OPTIONS("/*paths", s.FwdOptionsReq(rp)) | |
fmt.Println("Routes Registered") | |
return r | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment