RED.httpAdmin.get("/listStored", RED.auth.needsPermission('node.read'), function(req,res) {
let listFromGlobal = //How to access global context from here
res.json(listFromGlobal);
});
But from here how to access the global context ?
I looked at the documentation on RED module butunderstand how to use it
In general you shouldn't be exposing global context in this way.
How does that list get into global context to begin with?
The runtime already provides an endpoint for querying context - as used by the context sidebar. I don't have the specific details to hand, but if you use the browser tools to examine the network requests the editor makes when you have the context sidebar open and click the 'refresh' button, you should be able to identify the endpoint.
Doh! It hadn't occurred to me to try that method when I put together uibuilder's caching node. I did it via an API call. Though in my case, not sure that this method helps that much since I need the same functions in the js file of the node anyway - all it saves is an API endpoint and they use pretty much all standard code.
There is no api for updating context from the editor. The url you shared there is the one to trigger an inject node - that has nothing to do with context.