From 4684694b7aa0a002354153519be9c7bcc9bfb30f Mon Sep 17 00:00:00 2001 From: rxdn <29165304+rxdn@users.noreply.github.com> Date: Thu, 28 Jul 2022 19:36:20 +0100 Subject: [PATCH] Add robots.txt to API --- app/http/server.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/http/server.go b/app/http/server.go index 9d775a7..1ec3254 100644 --- a/app/http/server.go +++ b/app/http/server.go @@ -21,7 +21,6 @@ import ( "github.com/TicketsBot/common/permission" "github.com/getsentry/sentry-go" sentrygin "github.com/getsentry/sentry-go/gin" - "github.com/gin-contrib/static" "github.com/gin-gonic/gin" "log" "time" @@ -40,9 +39,6 @@ func StartServer() { // Sessions session.Store = session.NewRedisStore() - // Handle static asset requests - router.Use(static.Serve("/assets/", static.LocalFile("./public/static", false))) - router.Use(gin.Recovery()) router.Use(middleware.MultiReadBody, middleware.ReadResponse) router.Use(middleware.Logging(sentry.LevelError)) @@ -57,6 +53,9 @@ func StartServer() { // util endpoints router.GET("/ip", root.IpHandler) + router.GET("/robots.txt", func(ctx *gin.Context) { + ctx.String(200, "Disallow: /") + }) router.GET("/webchat", root.WebChatWs)