Skip to content

Instantly share code, notes, and snippets.

@JajoScript
Created July 25, 2023 13:39
Show Gist options
  • Save JajoScript/5bc65dbe477e50f9970b242c7b9896f4 to your computer and use it in GitHub Desktop.
Save JajoScript/5bc65dbe477e50f9970b242c7b9896f4 to your computer and use it in GitHub Desktop.
Handler ES5
const logger = require("firebase-functions/logger") // Optional logger from Firebase.
async function handler(params) {
return new Promise(async (resolve, reject) => {
try {
// Code here ...
return resolve();
} catch (err) {
logger.warn("something wrong in handler", err);
return reject(err);
}
});
}
module.exports = handler;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment