2023-06-25 00:10:57 +05:30
|
|
|
package pages
|
|
|
|
|
|
|
|
import (
|
|
|
|
"codeberg.org/aryak/simplytranslate/utils"
|
2023-07-22 19:54:15 +05:30
|
|
|
"fmt"
|
2023-06-25 00:10:57 +05:30
|
|
|
"github.com/gofiber/fiber/v2"
|
2023-07-22 19:54:15 +05:30
|
|
|
"runtime"
|
2023-06-25 00:10:57 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
func HandleIndex(c *fiber.Ctx) error {
|
2023-07-22 19:54:15 +05:30
|
|
|
// 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-25 00:10:57 +05:30
|
|
|
return c.Render("index", fiber.Map{
|
|
|
|
"host": c.Hostname(),
|
|
|
|
"version": utils.Version(),
|
|
|
|
"fiberversion": fiber.Version,
|
|
|
|
"goversion": runtime.Version(),
|
|
|
|
})
|
|
|
|
}
|