@tutorbot/gcf-helper
v1.1.11
Published
The helper for run pub/sub handlers on GCF(google cloud functions) environment.
Downloads
6
Keywords
Readme
@tutorbot/gcf-helper
yarn add @tutorbot/gcf-helper
environment variables
MONGODB_EVENT_USERNAME=username
MONGODB_EVENT_PASSWORD=password
MONGODB_EVENT_HOST=localhost
MONGODB_EVENT_PORT=27017
MONGODB_EVENT_DB=event
example
exports.subscribe = require("@tutorbot/gcf-helper")(async (data, context) => {
// data is the event
console.log(data, context);
// do something
// ...
// something went wrong
throw new Error("something went wrong")
});