aboutsummaryrefslogtreecommitdiff
path: root/.config/startpage/server.go
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-03-21 14:35:21 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-03-21 14:35:21 +0530
commitfd98b1d6671858a2a725634c82d6907ec25771ea (patch)
tree2033a7c2ab14f588d698e86d5a4b5e5f2be2c20c /.config/startpage/server.go
parent4e719d6ca4af5a7d56f37f2ec5ef5e59118b03b4 (diff)
FINALLY THIS WORKS PROPERLY (Pushing all the dotfiles)
Diffstat (limited to '.config/startpage/server.go')
-rw-r--r--.config/startpage/server.go22
1 files changed, 22 insertions, 0 deletions
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")
+}