From fbf74effcd295154e94395e992b0054a09310919 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Thu, 5 Oct 2023 21:31:23 +0530 Subject: [PATCH] add copy translation link --- serve/serve.go | 6 ++---- views/index.html | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/serve/serve.go b/serve/serve.go index 923ec73..e7304f5 100644 --- a/serve/serve.go +++ b/serve/serve.go @@ -84,8 +84,7 @@ func Serve(port string) { }) api := app.Group("/api") - api.Get("/translate", pages.HandleTranslate) - api.Post("/translate", pages.HandleTranslate) + api.All("/translate", pages.HandleTranslate) api.Get("/source_languages", pages.HandleSourceLanguages) api.Get("/target_languages", pages.HandleTargetLanguages) api.Get("/tts", pages.HandleTTS) @@ -97,8 +96,7 @@ func Serve(port string) { }) api.Get("/swagger/*", swagger.HandlerDefault) // default - app.Get("/", pages.HandleIndex) - app.Post("/", pages.HandleIndex) + app.All("/", pages.HandleIndex) app.Get("/about", pages.HandleAbout) app.Get("/switchlanguages", func(c *fiber.Ctx) error { engine := c.Query("engine") diff --git a/views/index.html b/views/index.html index e94c351..6808cd9 100644 --- a/views/index.html +++ b/views/index.html @@ -95,6 +95,7 @@ + {{ if and .Engine .From .To .OriginalText }}

Copy translation link

{{end}}