You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
531 B

const express = require('express');
require('dotenv').config()
const { execSync } = require('child_process');
const app = express()
app.use(express.json())
app.post('/test', (req, res)=>{
const resumeFlag = ``
const result = execSync(
`cd /home/matt/pathfinder && claude -p "${req.body.message}" ${resumeFlag} --output-format json --allowedTools "Bash(*)" "Read(*)" "Write(*)" "Edit(*)"`,
{ encoding: 'utf-8', timeout: 120000 }
);
res.json(JSON.parse(result))
})
console.log(process.env.SESSIONID);
app.listen(3000);