0

I have been using Deployd for a week or so, and was curious if I could expose the contents of the Collections Event Script itself, from the API. (the contents of the /my-project/resources/my-collection/get.js file itself)

This could be useful to automatically produce documentation of the scripts being applied to Get, Post and other requests.

Thanks for the help,

Jacob

Jacob Flatter
  • 171
  • 2
  • 11

1 Answers1

0

This is what I have so far: If I start at localhost:2404/dashboard , I can run the following code in the Chrome Console to retrieve the string content of the GET Event on the collection Tshirts:

dpd('__resources').get(Context.resourceId + '/' + 'get.js', function(res, err) 
    { 
      _events['get'] = res && res.value; 
      console.log(res.value); 
    });

Context.resourceId simplifies to the collection ID which is just "tshirts".

This successfully outputs the data I am trying to access, but I wonder if it is possible to retrieve from the API. I imagine I need to dig into Node.JS in general to wrap my head around this.

Thanks again,

Jacob

Jacob Flatter
  • 171
  • 2
  • 11