23 lines
350 B
Go
23 lines
350 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
msg := os.Getenv("HELLO_MSG")
|
|
if msg == "" {
|
|
msg = "hi from someone elses gitea"
|
|
}
|
|
port := os.Getenv("PORT")
|
|
if port == "" {
|
|
port = "8080"
|
|
}
|
|
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Fprintln(w, msg)
|
|
})
|
|
http.ListenAndServe(":"+port, nil)
|
|
}
|