mirror of
https://codeberg.org/aryak/mozhi
synced 2024-11-18 12:22:57 +05:30
28 lines
570 B
Go
28 lines
570 B
Go
package pages
|
|
|
|
import (
|
|
"codeberg.org/aryak/simplytranslate/utils"
|
|
"fmt"
|
|
"github.com/gofiber/fiber/v2"
|
|
"runtime"
|
|
)
|
|
|
|
func HandleIndex(c *fiber.Ctx) error {
|
|
// 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")
|
|
}
|
|
|
|
return c.Render("index", fiber.Map{
|
|
"host": c.Hostname(),
|
|
"version": utils.Version(),
|
|
"fiberversion": fiber.Version,
|
|
"goversion": runtime.Version(),
|
|
})
|
|
}
|