Skip to content

Commit

Permalink
Redoc support added
Browse files Browse the repository at this point in the history
  • Loading branch information
500Foods committed Oct 21, 2023
1 parent 90a6595 commit bd73675
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions Unit1.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ object ServerContainer: TServerContainer
SwaggerUIOptions.Enabled = True
SwaggerUIOptions.ShowFilter = True
SwaggerUIOptions.TryItOutEnabled = True
RedocOptions.Enabled = True
Left = 216
Top = 16
object XDataServerCORS: TSparkleCorsMiddleware
Expand Down
7 changes: 5 additions & 2 deletions Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ TServerContainer = class(TDataModule)
function GetIP: String;
procedure GetVersionInfo;
public
REST_URL:string;
SWAG_URL: string;
REST_URL: String;
SWAG_URL: String;
REDOC_URL: String;
ServerIP: String;
AppVersionString: String;
AppVersionShort: String;
Expand Down Expand Up @@ -189,12 +190,14 @@ procedure TServerContainer.DataModuleCreate(Sender: TObject);
XDataServer.BaseURL := 'http://+:2001/tms/xdata';
REST_URL := 'http://localhost:2001/tms/data';
SWAG_URL := 'http://localhost:2001/tms/xdata/swaggerui';
REDOC_URL := 'http://localhost:2001/tms/xdata/redoc';
end
else
begin
XDataServer.BaseURL := 'https://+:10101/500Surveys';
REST_URL := 'https://carnival.500foods.com:10101/500Surveys';
SWAG_URL := 'https://carnival.500foods.com:10101/500Surveys/swaggerui';
REDOC_URL := 'https://carnival.500foods.com:10101/500Surveys/redoc';
end;

// NOW we can start this
Expand Down
9 changes: 9 additions & 0 deletions Unit2.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,13 @@ object MainForm: TMainForm
TabOrder = 3
OnClick = btSwaggerClick
end
object btRedoc: TButton
Left = 252
Top = 8
Width = 75
Height = 25
Caption = 'Redoc'
TabOrder = 4
OnClick = btRedocClick
end
end
10 changes: 10 additions & 0 deletions Unit2.pas
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ TMainForm = class(TForm)
btStart: TButton;
btStop: TButton;
btSwagger: TButton;
btRedoc: TButton;
procedure btStartClick(ASender: TObject);
procedure btStopClick(ASender: TObject);
procedure FormCreate(ASender: TObject);
procedure btSwaggerClick(Sender: TObject);
procedure btRedocClick(Sender: TObject);
strict private
procedure UpdateGUI;
end;
Expand All @@ -46,6 +48,14 @@ implementation

{ TMainForm }

procedure TMainForm.btRedocClick(Sender: TObject);
var
url: String;
begin
url := ServerContainer.REDOC_URL;
ShellExecute(0, 'open', PChar(url), nil, nil, SW_SHOWNORMAL);
end;

procedure TMainForm.btStartClick(ASender: TObject);
begin
ServerContainer.SparkleHttpSysDispatcher.Start;
Expand Down

0 comments on commit bd73675

Please sign in to comment.