This is a migrated thread and some comments may be shown as answers.

How to manage re-used settings used across Cloud Code data & functions?

2 Answers 60 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ptw
Top achievements
Rank 1
ptw asked on 16 Mar 2016, 12:46 PM

Anyone know if there is a nice way to store (and access) settings that are re-used across back-end functions?

For example, say you have several functions accessing an external API with the same API Key and credentials. Hard-coding the credentials (and other similar settings) into every function seems messy ...and time consuming if they need to be changed. Perhaps a file that contains a Javascript object of the settings, and that is called/included at the start of backend data and functions.

Any ideas? Thanks.

 

2 Answers, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 18 Mar 2016, 11:12 AM
Hi,

Thanks for posting to the Telerik Developer Forums.

Indeed this would be a nice addition to the Business Logic layer. We have some ideas in our backlog about adding capabilities for easy code reuse and management in the cloud code/cloud functions. Currently we cannot commit to a particular time-frame for the actual implementation though.

At the current stage the easiest way to accomplish this is to have the credentials and settings in just one function and call this function with parameters from the other places in the cloud code layer.

Let me know should you have further questions or considerations.

Regards,
Anton Dobrev
Telerik
 
Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
 
0
Matt
Top achievements
Rank 1
answered on 26 Jul 2016, 01:45 PM

Hey, probably late to this response...

 

we had the exact need (a custom guid we need to store used across multiple cloud functions).  i used a cloud data table and using everlive.sdk referenced a field from all my functions.  this was easier to edit for us as it's a data field (vs. getting into the code).  we actually set up two apps, a 'Dev' and a 'Live' which have different app-ids.  in our code, we just change the app-id reference to get to the different cloud functions -- that way i can experiment with cloud code an not mess up my live environment.  also gives me a different data table with dev-settings/properties than my live data-table and properties.

 

has worked very well for our needs.  hope it helps give you ideas!

Matt

Tags
General Discussion
Asked by
ptw
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Matt
Top achievements
Rank 1
Share this question
or