Removed old-not-working ws implementation
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
b46f6df500
commit
c3f683b030
|
@ -17,24 +17,4 @@ setInterval(function() {
|
|||
}
|
||||
});
|
||||
});
|
||||
}, 1000);
|
||||
/*
|
||||
var loc = window.location;
|
||||
var uri = 'ws:';
|
||||
|
||||
if (loc.protocol === 'https:') {
|
||||
uri = 'wss:';
|
||||
}
|
||||
uri += '//' + loc.host;
|
||||
uri += loc.pathname + 'ws';
|
||||
|
||||
ws = new WebSocket(uri)
|
||||
|
||||
ws.onopen = function() {
|
||||
console.log('Connected');
|
||||
ws.send('get');
|
||||
};
|
||||
|
||||
ws.onmessage = function(evt) {
|
||||
console.log(evt.data);
|
||||
};*/
|
||||
}, 1000);
|
|
@ -42,8 +42,6 @@ func RegisterRoutes(e *echo.Echo) {
|
|||
e.GET("/admin", adminHandler)
|
||||
e.GET("/", showList)
|
||||
|
||||
e.GET("/ws", ws)
|
||||
|
||||
e.POST("/login", login)
|
||||
e.GET("/logout", logout)
|
||||
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
package router
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
func ws(c echo.Context) error {
|
||||
//Datenbankverbindung aufbauen
|
||||
/*db := DBinit()
|
||||
|
||||
// Websocket
|
||||
websocket.Handler(func(ws *websocket.Conn) {
|
||||
defer ws.Close()
|
||||
for {
|
||||
msg := ""
|
||||
err := websocket.Message.Receive(ws, &msg)
|
||||
if err != nil {
|
||||
c.Logger().Error(err)
|
||||
}
|
||||
fmt.Println(msg)
|
||||
|
||||
//Daten holen und anzeigen
|
||||
var kofi []Kofi
|
||||
err = db.OrderBy("KCoins DESC").Find(&kofi)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
kofiJson, err := json.Marshal(kofi)
|
||||
// Wegschicken
|
||||
err = websocket.Message.Send(ws, string(kofiJson))
|
||||
if err != nil {
|
||||
c.Logger().Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
}).ServeHTTP(c.Response(), c.Request())*/
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue