Removed old-not-working ws implementation
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2019-09-03 22:17:12 +02:00
parent b46f6df500
commit c3f683b030
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 1 additions and 61 deletions

View File

@ -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);

View File

@ -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)

View File

@ -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
}