Commit 315cba1f by Michael Brachmann

debugging websocket

parent 3c45b28a
......@@ -11,7 +11,7 @@ object WsServerModule: TWsServerModule
end
object XDataServer1: TXDataServer
Dispatcher = SparkleHttpSysDispatcher3
ModelName = 'Ws'
ModelName = 'WsApi'
EntitySetPermissions = <>
SwaggerOptions.Enabled = True
SwaggerUIOptions.Enabled = True
......
......@@ -7,12 +7,13 @@ uses
System.JSON;
const
WS_MODEL = 'Ws';
WS_MODEL = 'WsApi';
type
[ServiceContract, Model(WS_MODEL)]
IWebSocketService = interface(IInvokable)
['{673FE678-D9EF-468D-89CB-CEF26E8758BC}']
[HttpGet] function Ping: TJSONObject;
[HttpGet] function WebSockerConnectionHandler: TJSONObject;
end;
......
......@@ -12,6 +12,7 @@ type
[ServiceImplementation]
TWebSocketService = class(TInterfacedObject, IWebSocketService)
public
function Ping: TJSONObject;
function WebSockerConnectionHandler: TJSONObject;
end;
......@@ -24,6 +25,13 @@ uses
Sparkle.Sys.Timer,
Sparkle.HttpServer.Context;
function TWebSocketService.Ping: TJSONObject;
begin
Result := TJSONObject.Create;
Result.AddPair('status', 'ok');
TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result);
end;
function TWebSocketService.WebSockerConnectionHandler: TJSONObject;
var
Upgrader: IWebSocketUpgrader;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment