mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-29 10:36:31 +00: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)
|
||
|
}
|