removed the example routes
This commit is contained in:
parent
c6cdec8e66
commit
4fce1da63c
45
docs/docs.go
45
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": [
|
||||
|
@ -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": [
|
||||
|
@ -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:
|
||||
|
@ -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))
|
||||
}
|
Loading…
Reference in New Issue
Block a user