mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 13:02:24 -05: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) | ||
|  | } |