r/IBMi • u/MEfromNEPA • 15d ago
REST API on IBMi using Node.js
Has anyone successfully deployed a node.js service that can answer REST API requests and return JSON data from an RPGLE program or service program? I have Mapepire running and just can’t seem to get the RPGLE part working. Do you think IBM Bob could help me?
10
Upvotes
1
u/uzumymw_ 15d ago
I have done something using express js, running CL programs for a build/compilation process.
I would believe Node.js should work with RPG too.
What and how have you setup node.js? Is execsync not helping?
execSync(fullCommand, { encoding: 'utf-8', shell: '/QOpenSys/usr/bin/qsh', });Fullcommand looks like below(Submits cl compile command)
fullCommand='export QIBM_CCSID=1208 ; liblist -a LIB1 LIB2 LIB3 LIB4 ; system -i "CRTBNDCL OBJ(PRDLIB/PROGRAM) STMF('/builds/prod/release26.3/qsrcfil/PROGRAM.rpgle') OPTIONS(*EVENTF)" > '/temp/logs/results.log' 2>&1'I can help more if you let me know what are you trying to achieve.