openfaas / templates-sdk

SDK resources for templates such as models and entrypoints
MIT License
10 stars 6 forks source link

Create sdk and read secrets method for use with Node.js/JavaScript #6

Open alexellis opened 4 years ago

alexellis commented 4 years ago

Task

Create sdk and read secrets method for use with Node.js in the node12 and node templates

Example

const sdk = require("openfaas-sdk")

let pass = await sdk.readSecret("db-pass")

await openDB("admin", pass)
mrsimonemms commented 4 years ago

That makes a lot of sense.

For the record, I wrote this for my Typescript template and the interface was pretty-much identical