From 4fce1da63cfaffc56b710b80c93c1f88a1014512 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Sat, 21 Jan 2023 17:56:25 -0800 Subject: [PATCH] removed the example routes --- docs/docs.go | 45 ------------------------------------------ docs/swagger.json | 45 ------------------------------------------ docs/swagger.yaml | 30 ---------------------------- routes/root.go | 50 ----------------------------------------------- 4 files changed, 170 deletions(-) delete mode 100644 routes/root.go diff --git a/docs/docs.go b/docs/docs.go index 781391a..aec79c5 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -304,51 +304,6 @@ const docTemplate = `{ "responses": {} } }, - "/hello/{who}": { - "get": { - "produces": [ - "text/plain" - ], - "tags": [ - "Debug" - ], - "summary": "Responds back with \"Hello x\" depending on param passed in.", - "parameters": [ - { - "type": "string", - "description": "Who", - "name": "who", - "in": "path", - "required": true - } - ], - "responses": {} - } - }, - "/helloworld": { - "get": { - "produces": [ - "text/plain" - ], - "tags": [ - "Debug" - ], - "summary": "Responds back with \"Hello world!\"", - "responses": {} - } - }, - "/ping": { - "get": { - "produces": [ - "text/plain" - ], - "tags": [ - "Debug" - ], - "summary": "Sends back \"pong\". Good to test with.", - "responses": {} - } - }, "/queue/discord/webhooks": { "get": { "produces": [ diff --git a/docs/swagger.json b/docs/swagger.json index 6b67c8c..dac3772 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -295,51 +295,6 @@ "responses": {} } }, - "/hello/{who}": { - "get": { - "produces": [ - "text/plain" - ], - "tags": [ - "Debug" - ], - "summary": "Responds back with \"Hello x\" depending on param passed in.", - "parameters": [ - { - "type": "string", - "description": "Who", - "name": "who", - "in": "path", - "required": true - } - ], - "responses": {} - } - }, - "/helloworld": { - "get": { - "produces": [ - "text/plain" - ], - "tags": [ - "Debug" - ], - "summary": "Responds back with \"Hello world!\"", - "responses": {} - } - }, - "/ping": { - "get": { - "produces": [ - "text/plain" - ], - "tags": [ - "Debug" - ], - "summary": "Sends back \"pong\". Good to test with.", - "responses": {} - } - }, "/queue/discord/webhooks": { "get": { "produces": [ diff --git a/docs/swagger.yaml b/docs/swagger.yaml index ba5a2cf..477699c 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -432,36 +432,6 @@ paths: tags: - Discord - Webhook - /hello/{who}: - get: - parameters: - - description: Who - in: path - name: who - required: true - type: string - produces: - - text/plain - responses: {} - summary: Responds back with "Hello x" depending on param passed in. - tags: - - Debug - /helloworld: - get: - produces: - - text/plain - responses: {} - summary: Responds back with "Hello world!" - tags: - - Debug - /ping: - get: - produces: - - text/plain - responses: {} - summary: Sends back "pong". Good to test with. - tags: - - Debug /queue/discord/webhooks: get: produces: diff --git a/routes/root.go b/routes/root.go deleted file mode 100644 index ae0626d..0000000 --- a/routes/root.go +++ /dev/null @@ -1,50 +0,0 @@ -package routes - -import ( - "fmt" - "net/http" - - "github.com/go-chi/chi/v5" -) - -func RootRoutes() chi.Router { - app := chi.NewRouter() - app.Route("/", func(r chi.Router) { - r.Get("/helloworld", helloWorld) - r.Get("/ping", ping) - r.Route("/hello/{who}", func(r chi.Router) { - r.Get("/", helloWho) - }) - }) - return app -} - -// HelloWorld -// @Summary Responds back with "Hello world!" -// @Produce plain -// @Tags Debug -// @Router /helloworld [get] -func helloWorld(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("Hello World!")) -} - -// Ping -// @Summary Sends back "pong". Good to test with. -// @Produce plain -// @Tags Debug -// @Router /ping [get] -func ping(w http.ResponseWriter, r *http.Request) { - msg := "pong" - w.Write([]byte(msg)) -} - -// HelloWho -// @Summary Responds back with "Hello x" depending on param passed in. -// @Param who path string true "Who" -// @Produce plain -// @Tags Debug -// @Router /hello/{who} [get] -func helloWho(w http.ResponseWriter, r *http.Request) { - msg := fmt.Sprintf("Hello %v", chi.URLParam(r, "who")) - w.Write([]byte(msg)) -}