added go test app
This commit is contained in:
1
tests/go/.godir
Normal file
1
tests/go/.godir
Normal file
@@ -0,0 +1 @@
|
|||||||
|
go
|
||||||
1
tests/go/Procfile
Normal file
1
tests/go/Procfile
Normal file
@@ -0,0 +1 @@
|
|||||||
|
web: go
|
||||||
20
tests/go/web.go
Normal file
20
tests/go/web.go
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
http.HandleFunc("/", hello)
|
||||||
|
fmt.Println("listening...")
|
||||||
|
err := http.ListenAndServe(":"+os.Getenv("PORT"), nil)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func hello(res http.ResponseWriter, req *http.Request) {
|
||||||
|
fmt.Fprintln(res, "hello, world")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user