Hi,
I have created node.js proxy and downloaded node module "apigeelint" into it.
package.json: { "dependencies": { "apigeelint": "" } }
I want to use this api to validate another api proxy for code analysis. Could you please help me on why proceed with this.
I could achive this by downloading node.js into local machine and install apigeelint with the below command.
>npm i -g install
And validated downloaded proxy bundle with the below command.
>apigeelint -s Proxy_path/ -f table.js
Help me on doing this process through api proxy as I asked above.
I don't know apigeelint in detail, but, first let's cover some basics: if you want an API Proxy to execute some nodejs logic, then you need to
This is standard "nodejs in Apigee Edge" stuff. You can see some of the nodejs code here.
From within the nodejs target, you cannot run a commandline command (like apigeelint). child_process.execFile won't work there. If you want to execute an external command, you may be able to do that via child_process.execFile() from within a hosted target.
I'm sorry, I recognize this may be a little confusing. I just referenced two different types of "target": node and hosted. Let me elaborate a little.
In either case you need to create a server to handle the inbound request.
If you want to run apigeelint, then you will need the client to attach the bundle to the inbound request. And then use something like the formidable module (or whatever) to retrieve the attached bundle. And then run the required logic in nodejs on that inbound file.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |