File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,13 @@ func (s *inMemoryServer) Load() (err error) {
102102 }
103103
104104 s .handleOpenAPI ()
105+
106+ for _ , proxy := range server .Proxies {
107+ memLogger .Info ("start to proxy" , "target" , proxy .Target )
108+ s .mux .HandleFunc (proxy .Path , func (w http.ResponseWriter , req * http.Request ) {
109+ fmt .Println ("catch all" , req .URL .Path )
110+ })
111+ }
105112 return
106113}
107114
Original file line number Diff line number Diff line change @@ -55,8 +55,14 @@ type Webhook struct {
5555 Request Request `yaml:"request" json:"request"`
5656}
5757
58+ type Proxy struct {
59+ Path string `yaml:"path" json:"path"`
60+ Target string `yaml:"target" json:"target"`
61+ }
62+
5863type Server struct {
5964 Objects []Object `yaml:"objects" json:"objects"`
6065 Items []Item `yaml:"items" json:"items"`
66+ Proxies []Proxy `yaml:"proxies" json:"proxies"`
6167 Webhooks []Webhook `yaml:"webhooks" json:"webhooks"`
6268}
You can’t perform that action at this time.
0 commit comments