From fd98b1d6671858a2a725634c82d6907ec25771ea Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Sun, 21 Mar 2021 14:35:21 +0530 Subject: FINALLY THIS WORKS PROPERLY (Pushing all the dotfiles) --- .config/startpage/background.jpg | Bin 0 -> 522763 bytes .config/startpage/index.html | 67 +++++++++++++++++++++++++++++++++++++++ .config/startpage/server.go | 22 +++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 .config/startpage/background.jpg create mode 100644 .config/startpage/index.html create mode 100644 .config/startpage/server.go (limited to '.config/startpage') diff --git a/.config/startpage/background.jpg b/.config/startpage/background.jpg new file mode 100644 index 0000000..3e8476f Binary files /dev/null and b/.config/startpage/background.jpg differ diff --git a/.config/startpage/index.html b/.config/startpage/index.html new file mode 100644 index 0000000..18b2dd2 --- /dev/null +++ b/.config/startpage/index.html @@ -0,0 +1,67 @@ + + + + + Welcome, Vidhu Kant! + + + +
+ {{ .time }} +
+ + + diff --git a/.config/startpage/server.go b/.config/startpage/server.go new file mode 100644 index 0000000..b2eef0c --- /dev/null +++ b/.config/startpage/server.go @@ -0,0 +1,22 @@ +package main + +import ( + "github.com/gin-gonic/gin" + "net/http" + "time" +) + +func main() { + router := gin.New() + router.LoadHTMLGlob("/home/zt/.config/startpage/index.html") + router.Static("main", "/home/zt/.config/startpage/") + + router.GET("/", func (c *gin.Context) { + time := time.Now().Format("15:04 02 Jan (Monday)") + c.HTML(http.StatusOK, "index.html", gin.H{ + "time": time, + }) + }) + + router.Run(":8081") +} -- cgit v1.2.3