Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

JSON file written/updated by Node.js server cannot be read by client and is reverted on app restart

Hi All,

 

I am updating a JSON file based on user input from the Node.js backend, the file is getting updated properly.

 

However, when I try to access it from client side after its updated, I get 'undefined' in http.get response.

 

Also, if I restart the application using 'cf restart' the file goes to its original state without the updates.

 

This is workig fine when I test on a local application, however, after pushing to cloud foundry, it behaves this way.

 

Anyone has faced such issues with their MindSphere App?

 

 

Regards,

Parag

 

 

1 REPLY 1

Re: JSON file written/updated by Node.js server cannot be read by client and is reverted on app rest

Legend
Legend
The state in CloudFoundry applications is transient, the filesystem is lost on any restart. That's intended behaviour in most cloud environments due to their dynamic nature.

If you want to store persistent state, you'll need to use one of the stateful backing services available:
https://developer.mindsphere.io/paas/paas-cloudfoundry-backingservices.html