Empty web app
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.idea
|
||||||
22
main.go
Normal file
22
main.go
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
port := os.Getenv("PORT")
|
||||||
|
if port == "" {
|
||||||
|
port = "80"
|
||||||
|
}
|
||||||
|
|
||||||
|
bind := fmt.Sprintf(":%s", port)
|
||||||
|
log.Printf("listening on %s", bind)
|
||||||
|
|
||||||
|
if err := http.ListenAndServe(bind, nil); err != nil {
|
||||||
|
log.Fatalf("listen: %s", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user