Skip to content
This repository was archived by the owner on May 2, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions examples/filesharing-bot/filesharing-bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ if (process.env.LP_CSDS) {
}

const agent = new Agent(conf);
const swift_domain = 'https://qa-objectstorage.dev.lprnd.net';
// use the Domain API to find your account's domain for the "swift" service
// https://developers.liveperson.com/essential-resources-domain-api.html
const swift_domain = 'qa-objectstorage.dev.lprnd.net';

let openConvs = {};

Expand Down Expand Up @@ -136,7 +138,7 @@ function shareFile(convId, caption) {

function uploadFile(convId, caption, domain, relativePath, params, callback) {
const file = path.resolve(__dirname, 'lp-logo.jpeg');
const url = `${domain}${relativePath}${params}`;
const url = `https://${domain}${relativePath}${params}`;

fs.createReadStream(file).pipe(request.put(url, (err, response) => {
if (err) {
Expand All @@ -162,5 +164,6 @@ function downloadFile(relativePath) {
console.log('path params: ');
console.log('expires: ' + res.queryParams.temp_url_expires);
console.log('signature: ' + res.queryParams.temp_url_sig);
console.log('url: ' + `https://${swift_domain}${res.relativePath}?temp_url_sig=${res.queryParams.temp_url_sig}&temp_url_expires=${res.queryParams.temp_url_expires}`);
});
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.