aboutsummaryrefslogtreecommitdiff
path: root/.config/startpage/server.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com>2021-04-08 16:41:50 +0530
committerVidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com>2021-04-08 16:41:50 +0530
commit6e9091e26593a145e6350a01bad53f26acea75a1 (patch)
tree2d841fa503d20560d2f6e57a33c8ded65d817be8 /.config/startpage/server.go
parentf94c1202afce479d61ff833d8cd05fe417c98288 (diff)
pushing all the dotfiles again
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")
+}