-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.prg
35 lines (32 loc) · 1.12 KB
/
Main.prg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
&& -------------------------------------------------------- &&
* <(_screen.oHelper.oLanguage.Translate("_6Q80XDL46"))>
&& -------------------------------------------------------- &&
#include "macros.h"
DEFINE CLASS <(lcClassName)> AS Base OLEPUBLIC
cHost = "<(ALLTRIM(loService.cHost))>"
nPort = <(loService.nPort)>
oRequest = .NULL.
oResponse = .NULL.
oJson = .NULL.
oFoxServer = .null.
oHelper = .null.
cAPIPath = ""
PROCEDURE AddControllers
* <(_screen.oHelper.oLanguage.Translate("_6Q80XFXE0"))>
ROUTE("/hello", "pHello")
* <(_screen.oHelper.oLanguage.Translate("_6Q91CY4IV"))>
*!* CONTROLLER("/productos", CREATEOBJECT("ProductosController"))
ENDPROC
* <(_screen.oHelper.oLanguage.Translate("_6Q80XGUMG"))>
PROCEDURE pHello
CONTENT_TYPE("application/json")
CONTENT(GET_JSON_RESPONSE("correcta", .null., "VFP Rocks!"))
ENDPROC
*----------------------------------------------------------*
** HELPER METHODS
*----------------------------------------------------------*
Procedure ParseJsonBodyFromRequest
this.loadJsonFox()
this.oJson = _Screen.json.parse(GET_BODY())
EndProc
ENDDEFINE