Created
September 3, 2021 19:12
-
-
Save khyberspache/7ee3d7e1426bf405c69d39670aeed61c to your computer and use it in GitHub Desktop.
Example of hush handling an API task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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