Skip to content

Instantly share code, notes, and snippets.

@khyberspache
Created September 3, 2021 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khyberspache/7ee3d7e1426bf405c69d39670aeed61c to your computer and use it in GitHub Desktop.
Save khyberspache/7ee3d7e1426bf405c69d39670aeed61c to your computer and use it in GitHub Desktop.
Example of hush handling an API task
if (task[0] === 'api') {
if (task[2]) {
try {
task[2] = JSON.parse(task[2]);
} catch (e) {
throw new Error("Could not parse module params: "+e.toString());
}
}
return runModule(task[0], task[1], task[2] || null);
}
return runModule('shell', link.Executor, {task: link.Request});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment