diff --git a/app/server.go b/app/server.go index 0d7df31..e2e6f44 100644 --- a/app/server.go +++ b/app/server.go @@ -7,6 +7,10 @@ import ( "os" ) +func handleConnection(conn net.Conn) { + fmt.Fprintf(conn, "HTTP/1.1 200 OK\r\n\r\n") +} + func main() { // You can use print statements as follows for debugging, they'll be visible when running tests. fmt.Println("Logs from your program will appear here!") @@ -19,9 +23,13 @@ func main() { os.Exit(1) } - _, err = l.Accept() - if err != nil { - fmt.Println("Error accepting connection: ", err.Error()) - os.Exit(1) + for { + conn, err := l.Accept() + if err != nil { + fmt.Println("Error accepting connection: ", err.Error()) + os.Exit(1) + } + go handleConnection(conn) } + }