How to load JSON from disk? (NodeJS)

Hi,

Does anyone know if it’s possible to load a JSON file from disk for usage on Server Actions?

I’m using NodeJS

Maybe if you call as local url it might work

2 Likes

Brilliant trick! Thanks!

If someone else has a better way to do it, feel free to post

Edit:

This is how I did, custom code in URL:

'http://127.0.0.1:'+$_ENV.PORT+'/myjson.json'
1 Like

Custom module.