Files
go/server.go

26 lines
695 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"
"io"
"net/http"
2020-07-28 13:21:40 +09:00
"github.com/microsoft/vscode-remote-try-go/hello"
2019-05-03 10:34:17 -07:00
)
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() {
2020-07-28 13:21:40 +09:00
portNumber := "5000"
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)
}