From a711e5742de7176ea3faf73654e06ae82a559a09 Mon Sep 17 00:00:00 2001 From: Elias Kohout Date: Fri, 20 Dec 2024 01:15:56 +0100 Subject: [PATCH] init --- cmd/main.go | 25 ++++++++++++++++ go.mod | 3 ++ static/index.html | 75 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 cmd/main.go create mode 100644 go.mod create mode 100644 static/index.html diff --git a/cmd/main.go b/cmd/main.go new file mode 100644 index 0000000..d3e8eff --- /dev/null +++ b/cmd/main.go @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "net/http" +) + +func test(w http.ResponseWriter, req *http.Request) { + for name, headers := range req.Header { + for _, h := range headers { + fmt.Fprintf(w, "%v: %v\n", name, h) + } + } +} + +func main() { + http.HandleFunc("/test", test) + + // Serve files from the "static" directory + fs := http.FileServer(http.Dir("./static")) + http.Handle("/", http.StripPrefix("/", fs)) + + + http.ListenAndServe(":8090", nil) +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..bf50988 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module frontend + +go 1.23.3 diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..16da73d --- /dev/null +++ b/static/index.html @@ -0,0 +1,75 @@ + + + + + + + Dark Mode Article Previews + + + + + + +
+

Article Previews

+
+ +
+
+
Article Title 1
+

This is a short preview of the article content. It provides a quick summary to entice readers to click and read more.

+ Read More +
+
+ +
+
+
Article Title 2
+

This is another preview of an article. It gives a brief overview to encourage users to explore further.

+ Read More +
+
+ +
+
+
Article Title 3
+

A concise description of the article to pique interest and direct readers to the full content.

+ Read More +
+
+
+
+ + + + + +