make dockerfile copy static and views
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package pages
|
||||
|
||||
import (
|
||||
"codeberg.org/aryak/mozhi/utils"
|
||||
libmozhi "codeberg.org/aryak/libmozhi"
|
||||
"codeberg.org/aryak/mozhi/utils"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
@@ -72,7 +72,7 @@ func HandleTTS(c *fiber.Ctx) error {
|
||||
// @Param from query string true "Source language"
|
||||
// @Param to query string true "Target language"
|
||||
// @Param text query string true "Text being translated"
|
||||
// @Success 200 {object} libmozhi.LangOut
|
||||
// @Success 200 {object} libmozhi.LangOut
|
||||
// @Router /api/translate [get]
|
||||
func HandleTranslate(c *fiber.Ctx) error {
|
||||
engine := utils.Sanitize(c.Query("engine"), "alpha")
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package pages
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"codeberg.org/aryak/libmozhi"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func HandleIndex(c *fiber.Ctx) error {
|
||||
@@ -17,7 +17,7 @@ func HandleIndex(c *fiber.Ctx) error {
|
||||
if c.Query("engine") == name {
|
||||
engine = c.Query("engine")
|
||||
}
|
||||
}
|
||||
}
|
||||
if engine == "" {
|
||||
engine = "google"
|
||||
}
|
||||
@@ -46,9 +46,9 @@ func HandleIndex(c *fiber.Ctx) error {
|
||||
//ttsFrom = "/api/tts?lang="+translation.AutoDetect+"&engine="+engine+"&text="+originalText
|
||||
ttsFrom = ""
|
||||
} else {
|
||||
ttsFrom = "/api/tts?lang="+from+"&engine="+engine+"&text="+originalText
|
||||
ttsFrom = "/api/tts?lang=" + from + "&engine=" + engine + "&text=" + originalText
|
||||
}
|
||||
ttsTo = "/api/tts?lang="+to+"&engine="+engine+"&text="+translation.OutputText
|
||||
ttsTo = "/api/tts?lang=" + to + "&engine=" + engine + "&text=" + translation.OutputText
|
||||
}
|
||||
}
|
||||
return c.Render("index", fiber.Map{
|
||||
|
||||
Reference in New Issue
Block a user