first commit of files
This commit is contained in:
18
server/allBuses.go
Normal file
18
server/allBuses.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func (s *Server) AllBuses(c *gin.Context) {
|
||||
var data any
|
||||
if s.Driver.Bus == nil {
|
||||
data = "no buses avaiable"
|
||||
} else {
|
||||
data = s.Driver.Bus
|
||||
}
|
||||
|
||||
c.JSON(200, gin.H{
|
||||
"buses": data,
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user