All files / api-build/utils handler-local.js

25% Statements 2/8
100% Branches 0/0
0% Functions 0/2
25% Lines 2/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171x   1x                            
const path = require('path');
 
exports.go = (event, context, callback) => {
  require(`${event.entrypoint}`);
  const api = require(path.join(process.cwd(), 'node_modules/api-build/api'));
  try {
    api.actions[event.name](event.data, {
      success: api.success(callback),
      error: api.error,
      log: () => {},
    });
  } catch (e) {
    const error = api._handlerUtils.parseErrors(event, e);
    callback(JSON.stringify(error), null);
  }
};