Add Version
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"io"
|
||||
_ "embed"
|
||||
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -9,6 +10,9 @@ import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
//go:embed VERSION
|
||||
var version string
|
||||
|
||||
func Api(c *fiber.Ctx) error {
|
||||
// Get the url from the URL
|
||||
urlQuery := c.Params("*")
|
||||
@@ -41,6 +45,7 @@ func Api(c *fiber.Ctx) error {
|
||||
}
|
||||
body := rewriteHtml(bodyB, u)
|
||||
response := Response{
|
||||
Version: version,
|
||||
Body: body,
|
||||
}
|
||||
response.Request.Headers = make([]interface{}, 0)
|
||||
@@ -63,6 +68,7 @@ func Api(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Version string `json:"version"`
|
||||
Body string `json:"body"`
|
||||
Request struct {
|
||||
Headers []interface{} `json:"headers"`
|
||||
|
||||
Reference in New Issue
Block a user