Last active
January 7, 2019 17:03
-
-
Save Hecatoncheir/1180479de480d7e36d6d7aef08babe59 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
| apiVersion: serving.knative.dev/v1alpha1 | |
| kind: Service | |
| metadata: | |
| name: test | |
| namespace: default | |
| spec: | |
| runLatest: | |
| configuration: | |
| revisionTemplate: | |
| metadata: | |
| annotations: | |
| # Target 10 in-flight-requests per pod. | |
| autoscaling.knative.dev/target: "50" | |
| spec: | |
| container: | |
| image: docker.io/test |
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 main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| ) | |
| func handler(w http.ResponseWriter, r *http.Request) { | |
| response, err := http.Get("https://httpbin.org/get") | |
| if err != nil { | |
| fmt.Println(err) | |
| } | |
| body, err := ioutil.ReadAll(response.Body) | |
| _, err = w.Write(body) | |
| if err != nil { | |
| fmt.Println(err) | |
| } | |
| } | |
| func main() { | |
| http.HandleFunc("/", handler) | |
| err := http.ListenAndServe(":8080", nil) | |
| if err != nil { | |
| fmt.Println(err) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment