Last active
August 26, 2015 14:45
-
-
Save dsabeti/4cfb8380b4213286d6e1 to your computer and use it in GitHub Desktop.
64k log line CF test application
This file contains 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
main |
This file contains 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 "net/http" | |
import "os" | |
import "strconv" | |
import "strings" | |
import "fmt" | |
func main() { | |
port := os.Getenv("PORT") | |
server := NewServer() | |
http.Handle("/", server) | |
http.ListenAndServe(fmt.Sprintf(":%s", port), nil) | |
} | |
type server struct{} | |
func NewServer() *server { | |
return &server{} | |
} | |
func (s *server) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |
length, _ := strconv.Atoi(r.FormValue("length")) | |
fmt.Printf(strings.Repeat("s", length) + "\n") | |
} |
This file contains 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
web: main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment