Initial Release: OpenQode Public Alpha v1.3
This commit is contained in:
29
test_session.js
Normal file
29
test_session.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const http = require('http');
|
||||
|
||||
const data = JSON.stringify({
|
||||
sessions: {
|
||||
"test": { name: "Test Session", messages: [] }
|
||||
},
|
||||
currentSession: "test"
|
||||
});
|
||||
|
||||
const req = http.request({
|
||||
hostname: 'localhost',
|
||||
port: 3000,
|
||||
path: '/api/sessions/save',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Length': data.length
|
||||
}
|
||||
}, (res) => {
|
||||
console.log(`StatusCode: ${res.statusCode}`);
|
||||
res.on('data', d => process.stdout.write(d));
|
||||
});
|
||||
|
||||
req.on('error', (error) => {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
req.write(data);
|
||||
req.end();
|
||||
Reference in New Issue
Block a user