Files
go/src/main/server.go

25 lines
652 B
Go
Raw Normal View History

2019-04-19 13:16:41 -07:00
/*----------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*---------------------------------------------------------------------------------------*/
2019-05-03 10:34:17 -07:00
package main
import (
"fmt"
2019-06-15 13:38:07 +00:00
"hello"
2019-05-03 10:34:17 -07:00
"io"
"net/http"
)
2019-06-15 12:51:52 +00:00
func handle(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, hello.Hello())
2019-05-03 10:34:17 -07:00
}
func main() {
portNumber := "9000"
2019-06-15 12:51:52 +00:00
http.HandleFunc("/", handle)
2019-05-03 10:34:17 -07:00
fmt.Println("Server listening on port ", portNumber)
http.ListenAndServe(":"+portNumber, nil)
}