This repository was archived by the owner on Aug 22, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,4 +10,6 @@ AIR_TABLE_API_KEY=<your_key> ./airtable-api-proxy
1010```
1111
1212## Docker
13- WIP.
13+ ``` bash
14+ docker run -p 4242:4242 hookactions/airtable-api-proxy
15+ ```
Original file line number Diff line number Diff line change @@ -19,11 +19,13 @@ type transport struct {
1919 apiKey string
2020}
2121
22- func (t * transport ) RoundTrip (r * http.Request ) (* http.Response , error ) {
23- log .Printf ("Sending request to %q" , r .URL .String ())
22+ func (t * transport ) RoundTrip (r * http.Request ) (* http.Response , error ) {
23+ log .Printf ("Sending request, %s %s" , r .Method , r .URL .String ())
24+
2425 r .Host = r .URL .Host
2526 r .Header .Set ("Authorization" , fmt .Sprintf ("Bearer %s" , t .apiKey ))
2627 r .Header .Del ("X-Forwarded-For" )
28+
2729 return http .DefaultTransport .RoundTrip (r )
2830}
2931
@@ -48,7 +50,7 @@ func main() {
4850 airTableApiKey := os .Getenv ("AIR_TABLE_API_KEY" )
4951
5052 router := mux .NewRouter ()
51- router .HandleFunc ("/{version}/{app}/{resource}" , newProxyHandler (airTableApiKey )).Methods ("POST" )
53+ router .HandleFunc ("/{version}/{app}/{resource}" , newProxyHandler (airTableApiKey )).Methods ("POST" , "OPTIONS" )
5254
5355 srv := & http.Server {
5456 Handler : router ,
You can’t perform that action at this time.
0 commit comments