demo for any-gitea install

This commit is contained in:
hermes
2026-09-14 15:29:25 -07:00
commit 66d59c9b01
2 changed files with 25 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
module demo/hi
go 1.22
+22
View File
@@ -0,0 +1,22 @@
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)
}