mirror of
https://github.com/Starlio-app/StarlioX
synced 2024-12-26 14:13:46 +03:00
26 lines
508 B
Go
26 lines
508 B
Go
package controllers
|
|
|
|
import (
|
|
"net/http"
|
|
"os"
|
|
|
|
"github.com/Redume/EveryNasa/api/utils"
|
|
"github.com/Redume/EveryNasa/functions"
|
|
"gopkg.in/yaml.v2"
|
|
)
|
|
|
|
var Version = func(w http.ResponseWriter, r *http.Request) {
|
|
file, err := os.ReadFile("config.yaml")
|
|
if err != nil {
|
|
functions.Logger(err.Error())
|
|
}
|
|
|
|
data := make(map[interface{}]interface{})
|
|
|
|
err = yaml.Unmarshal(file, &data)
|
|
if err != nil {
|
|
functions.Logger(err.Error())
|
|
}
|
|
|
|
utils.Respond(w, utils.Message(true, data["version"].(string)))
|
|
}
|