Skip to content

Commit

Permalink
Update adding_external_tool_backend.md
Browse files Browse the repository at this point in the history
  • Loading branch information
NoxNovus authored Nov 7, 2024
1 parent 9b3c501 commit 6176b4a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/adding_external_tool_backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ You should add an endpoint for your backend tool here. The endpoint will look so
const input = req.body;
const safe_input = input.<YOUR_TOOL_INPUT>.replace(/'/g, "\\'");
try {
// The most important line is this next one. Include anything you need to run your executable or binary from the command line, and exec will run it from the command line as a command.
const { stdout, stderr } = await exec(
`cd ${odysseyDir} && .${<YOUR_TOOL_PATH>.replace(odysseyDir, '')} <(printf '${safe_input}')`,
{ shell: '/bin/bash' }
Expand All @@ -97,6 +98,8 @@ You should add an endpoint for your backend tool here. The endpoint will look so
})
```



The existing FPTaylor and FPBench endpoints serve as good examples to guide your implementation.


Expand Down

0 comments on commit 6176b4a

Please sign in to comment.