mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-16 08:15:53 +01:00
30 lines
438 B
ObjectPascal
30 lines
438 B
ObjectPascal
unit MainControllerU;
|
|
|
|
interface
|
|
|
|
uses
|
|
MVCFramework, MVCFramework.Commons;
|
|
|
|
type
|
|
|
|
[MVCPath('/api')]
|
|
TMyController = class(TMVCController)
|
|
public
|
|
[MVCPath]
|
|
[MVCHTTPMethod([httpGET])]
|
|
procedure Index;
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
System.SysUtils, MVCFramework.Logger, System.StrUtils;
|
|
|
|
procedure TMyController.Index;
|
|
begin
|
|
//use Context property to access to the HTTP request and response
|
|
Render('X');
|
|
end;
|
|
|
|
end.
|