XData Indy server and Services

This is my attempt to realize the Auth server from TMS Demos with Indy server, but this does not work, I'm got exception "Unknown path LoginService". What I should change to make it worked?


unit uSvc.Module;


interface


procedure StartServer;


implementation


{$R *.dfm}
uses
  Bcl.JOSE.Core.Builder,
  Bcl.JOSE.Core.JWT,
  XData.Service.Common,
  XData.Sys.Exceptions,


  Aurelius.Drivers.Base,
  Aurelius.Drivers.dbExpress,
  Sparkle.HttpSys.Config, Sparkle.Indy.Server,
  XData.Aurelius.ConnectionPool,
  uTypes, uPrgTypes, uLogs,
  uDB.Utils;


type
  [ServiceContract]
  ILoginService = interface(IInvokable)
  ['{9CFD59B2-A832-4F82-82BB-9A25FC93F305}']
    function Login(const User, Password: string): string;
  end;


  [ServiceImplementation]
  TLoginService = class(TInterfacedObject, ILoginService)
  public
    function Login(const User, Password: string): string;
  end;


{ TLoginService }


function TLoginService.Login(const User, Password: string): string;
var
  JWT: TJWT;
begin
  if User <> Password then
    raise EXDataHttpUnauthorized.Create('Invalid password');


  JWT := TJWT.Create;
  try
    JWT.Claims.SetClaimOfType<string>('user', User);
    JWT.Claims.SetClaimOfType<boolean>('admin', User = 'admin');
    Result := TJOSE.SHA256CompactToken('super_secret', JWT);
  finally
    JWT.Free;
  end;
end;


var
  Session: IDBSession;


var
  Server: TIndySparkleHTTPServer;


procedure StartServer;
var
  ConnFactory: IDBConnectionFactory;
begin
  Server := TIndySparkleHTTPServer.Create;
  try
    Server.DefaultPort := 2001;
    ConnFactory := TDBConnectionFactory.Create(
	  function: IDBConnection
      var
        Connection: TAureliusConnection;
      begin
        Connection := TAureliusConnection.Create(nil);
        Connection.Params.Values['Database'] := ':memory:';
        Connection.Params.Values['EnableForeignKeys']  := 'True';
        Connection.DriverName := 'SQLite';
        Result := Connection.CreateConnection;
      end
    );
    Server.Dispatcher.AddModule(TXDataServerModule.Create('http://+:2001/tms/auth',
      TDBConnectionPool.Create(50, ConnFactory)
    ));
    Server.Active := True;
  finally
//    Server.Free;
  end;
end;


initialization


  RegisterServiceType(TLoginService);


end.