From a4bf9c140ff5ab8db59c16cbd56077668d659aa8 Mon Sep 17 00:00:00 2001 From: Lewis Dale Date: Sun, 5 May 2024 08:25:27 +0100 Subject: [PATCH] Initialise the module, write my first request --- go.mod | 3 +++ main.go | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 go.mod create mode 100644 main.go diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..00b83c9 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module lewisdale.dev/oopsie + +go 1.22.2 diff --git a/main.go b/main.go new file mode 100644 index 0000000..8eab99b --- /dev/null +++ b/main.go @@ -0,0 +1,12 @@ +package main + +import ( + "net/http" +) + +func main() { + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Hello, World!")) + }) + http.ListenAndServe(":8000", nil) +}