Reference a JS file from within NodeJS script target

Not applicable

I have installed aio of 4.17.01 and trying to deploy some of the existing APIs in the older version. One of the API's script target refers js file under the subfolder. When I deploy the API, I am getting the error "The revision is deployed, but traffic cannot flow. Invalid Script name {0}".

Ex:

<ScriptTarget>
<ResourceURL>node://js/Server.js</ResourceURL>

</ScriptTarget>

Where it is working in the cloud without any issue.

--------------------------------------------------------------

When I try to mention the js without the subfolder is working well.

ScriptTarget>
<ResourceURL>node://server.js</ResourceURL>

</ScriptTarget>

Is there any property file needs to be updated to enable the script target to refer the js file in the subfolder?

1 5 235
5 REPLIES 5

Former Community Member
Not applicable

I don't think it works if you have server.js in a subfolder. server.js (or whichever main script file) must be in the parent folder.

But the sub folder reference is working fine in the cloud.

...working fine in the cloud.

which cloud? Edge SaaS ?

That would be a bit of a surprise. I've never seen that and I don't think that possibility is documented.

But no matter - you should be able to solve your problem easily by just inserting a bootstrap file in the toplevel, as Nandan suggested.

Yes it is working well in the SaaS (enterprise.apigee.com) cloud with a public account. Please let me know if you need more details on the API/org details.

The same subfolder reference is working in our on-prem old reference. I just try the API in the newer 4.17.01 version to cross check anything failed.

I don't need any further information.

But I think you have a good easy workaround, so you should use that, rather than getting wrapped around the axle on this one.