feat: start recording
This commit is contained in:
18
src/api/recording.ts
Normal file
18
src/api/recording.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { AxiosResponse } from "axios";
|
||||
|
||||
const axios = require('axios').default;
|
||||
|
||||
|
||||
export const startRecording = async() : Promise<string> => {
|
||||
try {
|
||||
const response = await axios.get('http://localhost:8080/record/start')
|
||||
if (response.status === 200) {
|
||||
return response.data;
|
||||
} else {
|
||||
throw new Error('Couldn\'t start recording');
|
||||
}
|
||||
} catch(error: any) {
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user