Commit e01fec71 authored by Tom Jorquera's avatar Tom Jorquera
Browse files

client: add lib.archive

Add client lib to archive transcripts of meetings.
parent 1b568488
'use strict';
/* global robotLib:true XMLHttpRequest */
robotLib.archive = function (config) {
return {
store(transcript) {
const xmlhttp = new XMLHttpRequest();
xmlhttp.open('POST', config.archive + '/json-handler');
xmlhttp.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
xmlhttp.send(JSON.stringify(transcript));
}
};
};
'use strict';
describe('client/lib/stt', () => {
beforeEach(() => {
global.robotLib = {};
/* eslint-disable import/no-unassigned-import */
require('./archive.js');
/* eslint-enable */
});
test('should define robotLib.archive', () => {
expect(global.robotLib.archive).toBeDefined();
});
});
......@@ -20,5 +20,6 @@
"name": "hublot",
"gstreamerURL": "ws://localhost:8888",
"externalLibs": []
"archive": "http://localhost:8080/api"
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment