mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-04-21 22:39:14 +00:00
Add version endpoint
This commit is contained in:
parent
e35ffdcc07
commit
ba9a0904cb
2 changed files with 12 additions and 0 deletions
2
main.go
2
main.go
|
@ -86,6 +86,8 @@ func main() {
|
||||||
|
|
||||||
r.GET("/proxy", routes.GetImage)
|
r.GET("/proxy", routes.GetImage)
|
||||||
|
|
||||||
|
r.GET("/version", routes.GetVersion)
|
||||||
|
|
||||||
soPingCheck := checks.NewPingCheck("https://stackoverflow.com", "GET", 5000, nil, nil)
|
soPingCheck := checks.NewPingCheck("https://stackoverflow.com", "GET", 5000, nil, nil)
|
||||||
sePingCheck := checks.NewPingCheck("https://stackexchange.com", "GET", 5000, nil, nil)
|
sePingCheck := checks.NewPingCheck("https://stackexchange.com", "GET", 5000, nil, nil)
|
||||||
healthcheck.New(r, config.DefaultConfig(), []checks.Check{soPingCheck, sePingCheck})
|
healthcheck.New(r, config.DefaultConfig(), []checks.Check{soPingCheck, sePingCheck})
|
||||||
|
|
10
src/routes/version.go
Normal file
10
src/routes/version.go
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
package routes
|
||||||
|
|
||||||
|
import (
|
||||||
|
"anonymousoverflow/config"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func GetVersion(c *gin.Context) {
|
||||||
|
c.String(200, config.Version)
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue