From 8b732b196dfca0371f084959239e1a5711094d65 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:07:39 -0600 Subject: [PATCH] An http server --- .gitignore | 1 + go.mod | 3 +++ main.go | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 .gitignore create mode 100644 go.mod create mode 100644 main.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e92c850 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/spoc-bot-vr diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..cd4b6ab --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/breel-render/spoc-bot-vr + +go 1.22.1 diff --git a/main.go b/main.go new file mode 100644 index 0000000..73571b8 --- /dev/null +++ b/main.go @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "net/http" + "os" +) + +func main() { + p := os.Getenv("PORT") + if p == "" { + p = "8080" + } + addr := fmt.Sprintf(":%s", p) + + if err := http.ListenAndServe(addr, http.HandlerFunc(http.NotFound)); err != nil { + panic(err) + } +}