package main

import (
	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()
	r.LoadHTMLFiles("index.html")
	r.GET("/ping", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"message": "pong",
		})
	})
	r.GET("/html", func(c *gin.Context) {
		c.HTML(200, "index.html", gin.H{
			"title": "Main website",
		})
	})
	r.GET("/getfiles", getfiles)
	r.Run() // listen and serve on 0.0.0.0:8080 (for windows "localhost:8080")
}

func getfiles(c *gin.Context) {
	c.File("./Halloworld.txt")
}
