XData standalone REST Server Linux

Hi,
there is any basic example how to create console project for Linux64 with XData?

Thanks

Andrea

For Linux console applications you have to use Sparkle Indy-based server.
Just create a console application, create the Indy-based server according to the documentation, and add the XData module to the Indy-based dispatcher.

Thank you.

Is working.

Regards

Andrea

CONFIDENTIALITY NOTICE

This e-mail and any enclosed file are confidential and may be privileged or otherwise protected from disclosure.

It is solely intended for the person(s) named above.

If you are not the intended recipient, any reading, use, disclosure, copying or distribution of all or parts of this e-mail or associated enclosed file is strictly prohibited.

If you are not an intended recipient, please notify the sender immediately by replying to this message or by telephone and delete this e-mail and any enclosed file permanently from your system.

1 Like

The last question, how to assign XDataServer.Dispatcher to Sparkle.Indy.Server?

Andrea

CONFIDENTIALITY NOTICE

This e-mail and any enclosed file are confidential and may be privileged or otherwise protected from disclosure.

It is solely intended for the person(s) named above.

If you are not the intended recipient, any reading, use, disclosure, copying or distribution of all or parts of this e-mail or associated enclosed file is strictly prohibited.

If you are not an intended recipient, please notify the sender immediately by replying to this message or by telephone and delete this e-mail and any enclosed file permanently from your system.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.

When you use TXDataServer, you can use CreateModule method:

uses
  {...}, Sparkle.Indy.Server;

procedure TForm1.FormCreate(Sender: TObject);
var
  Server: TIndySparkleHTTPServer;
begin
  Server: = TIndySparkleHTTPServer.Create(Self);
  Server.DefaultPort := 8080;
  Server.Dispatcher.AddModule(XDataServer1.CreateModule);
  Server.Active := True;
end;