Project WebSocket endpoint
This commit is contained in:
parent
4af6575516
commit
07e0743041
|
@ -1,6 +1,8 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/labstack/echo"
|
||||
"github.com/labstack/echo/engine/standard"
|
||||
"github.com/labstack/echo/middleware"
|
||||
|
@ -43,7 +45,9 @@ func (s *Server) Start() {
|
|||
func projects() websocket.Handler {
|
||||
return websocket.Handler(func(ws *websocket.Conn) {
|
||||
for {
|
||||
err := websocket.Message.Send(ws, "Hello")
|
||||
message, _ := json.Marshal(Bp)
|
||||
err := websocket.Message.Send(ws, string(message))
|
||||
fmt.Println(Bp)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue