1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00
This commit is contained in:
Gerasimos Maropoulos
2016-08-16 13:17:26 +03:00
parent c6f5406c3b
commit ca2e46f1c3
2 changed files with 13 additions and 6 deletions

View File

@@ -51,10 +51,13 @@ func RegisterWebsocketServer(station FrameworkAPI, server WebsocketServer, logge
}
}
}
clientSideLookupName := "iris-websocket-client-side"
station.Get(c.Endpoint, websocketHandler)
// serve the client side on domain:port/iris-ws.js
station.StaticContent("/iris-ws.js", "application/json", websocketClientSource)
// check if client side already exists
if station.Lookup(clientSideLookupName) == nil {
// serve the client side on domain:port/iris-ws.js
station.StaticContent("/iris-ws.js", "application/json", websocketClientSource)(clientSideLookupName)
}
}