mozhi/pages/index.go

28 lines
560 B
Go
Raw Normal View History

2023-06-24 18:40:57 +00:00
package pages
import (
"codeberg.org/aryak/mozhi/utils"
2023-07-22 14:24:15 +00:00
"fmt"
2023-06-24 18:40:57 +00:00
"github.com/gofiber/fiber/v2"
2023-07-22 14:24:15 +00:00
"runtime"
2023-06-24 18:40:57 +00:00
)
func HandleIndex(c *fiber.Ctx) error {
2023-07-22 14:24:15 +00:00
// Check if all required queries are present
m := c.Queries()
sl, _ := m["sl"]
tl, _ := m["tl"]
engine, _ := m["engine"]
text, _ := m["text"]
if sl != "" && tl != "" && engine != "" && text != "" {
fmt.Println("Work")
}
2023-06-24 18:40:57 +00:00
return c.Render("index", fiber.Map{
"host": c.Hostname(),
"version": utils.Version(),
"fiberversion": fiber.Version,
"goversion": runtime.Version(),
})
}