mirror of
https://codeberg.org/superseriousbusiness/gotosocial.git
synced 2024-12-25 02:18:16 +03:00
21 lines
465 B
Go
21 lines
465 B
Go
|
package instance
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
func (m *Module) InstanceInformationGETHandler(c *gin.Context) {
|
||
|
l := m.log.WithField("func", "InstanceInformationGETHandler")
|
||
|
|
||
|
instance, err := m.processor.InstanceGet(m.config.Host)
|
||
|
if err != nil {
|
||
|
l.Debugf("error getting instance from processor: %s", err)
|
||
|
c.JSON(http.StatusInternalServerError, gin.H{"error": "internal server error"})
|
||
|
return
|
||
|
}
|
||
|
|
||
|
c.JSON(http.StatusOK, instance)
|
||
|
}
|