handler.js
file is where you write your code. The following code should look familiar if you have ever written a node.js request module.ctx.token.username
.ctx.graphql.query
. Note that these queries are already authenticated via the JWT token included in the Function request.ctx.datastore.table('Table:5ada2d8f27b7b90001b9c40a')
. You can then add and query for Datastore data like so:.env
file allows you to determine whether or not this function should be protected behind DroneDeploy JWTs. The file is not mandatory. Typically when used your file should look like this (presented with default values):dronedeploy.js
file is the wrapper code for allowing DroneDeploy to handle things like auth and building function context. Your dronedeploy.js
file should look almost identical to the one below. The only modification might be the handler.helloWorld(req, res, ctx)
line to change which Node.js module export you would like to use.package.json
file is where you define your NPM dependencies."main"
field be dronedeploy.js
as that is how the platform knows which file to run.package.json
, you can install it by running the following command.