feat: Add Paarrot API server with endpoints for controlling app features
- Implemented API server using Express, including endpoints for health check, status, mute, deafen, channel management, and message sending. - Added middleware for CORS and JSON body parsing. - Created test scripts (Node.js and Bash) for API endpoint verification. - Documented API usage and integration in new API documentation files. - Updated package.json to include necessary dependencies (express, cors, body-parser).
This commit is contained in:
@@ -136,6 +136,18 @@ contextBridge.exposeInMainWorld('electron', {
|
||||
// Desktop capturer (for screen sharing)
|
||||
desktopCapturer: {
|
||||
getSources: (opts) => ipcRenderer.invoke('get-desktop-sources', opts)
|
||||
},
|
||||
|
||||
// API action handler (for external API server)
|
||||
api: {
|
||||
onAction: (callback) => {
|
||||
const handler = (_, data) => callback(data);
|
||||
ipcRenderer.on('api-action', handler);
|
||||
return () => ipcRenderer.removeListener('api-action', handler);
|
||||
},
|
||||
sendResponse: (channel, result) => {
|
||||
ipcRenderer.invoke(channel, result);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user