I want to configure pretty simple access to my REST resource, based on information (http://synopse.info/forum/viewtopic.php?id=1833) regarding REST routing in mORMot.
I need to call url as localhost/api/apservice/station/1
, but code below works only for calling as localhost/api/apservice/station?stationid={stationid}
IAPIService = interface(IInvokable)
['{0F23D411-C3F0-451A-8580-AB5BE6E521E6}']
function Station(StationID: Integer; out Station: TSQLStation): TCQRSResult;
end;
TAPIService = class(TInterfacedObject, IAPIService)
private
fDbConnection : TSQLDBConnectionProperties;
public
constructor Create(const aProps: TSQLDBConnectionProperties ); overload;
public
function Station(StationID: Integer; out Station: TSQLStation): TCQRSResult;
end;
Please advise how can I correctly configure REST routing to my resources? I need examples for:
- localhost/api/apservice/station/1 -
return details for station=1
- localhost/api/apservice/station/groups -
return all groups from station
- localhost/api/apservice/customers/{aCustomerId}/reports/orders/{aOrderNumber}/details?Filter={aDetailFilter}'