Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to serve static files in Nodejs from proxy on OPDK from a file system directory?

I am trying to server static files from Nodejs proxy. Since Nodejs support of "fs" module is limited to current working directory only I am not able to serve files from directories outside working directory.

One option could be to create a link of external directory say "/home/public-www/files" in current working directory. But the problem is every time we deploy proxy a new revision will be created and path to current working directory will change.

Is there a way to serve static files in apigee nodejs proxy?

Thanks!

Solved Solved
1 4 1,816
1 ACCEPTED SOLUTION

Hi @Diego Zuluaga,

Got this working using Java Callout on OPDK.

There is a way you can allow some Jar files access to higher directories.

Dino has answered similar question How API Proxy Can access File System.

Hope this will help others too.

Thanks..

View solution in original post

4 REPLIES 4