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}}