lbry.tech/app/helpers/publish-meme.js
ポール ウェッブ 3d93117df8 Closes #141
2018-09-24 12:55:01 -05:00

24 lines
567 B
JavaScript

"use strict";
// P A C K A G E
const request = require("request-promise-native");
// E X P O R T
module.exports = exports = publishMetadata => new Promise((resolve, reject) => request({ // eslint-disable-line
body: {
authorization: process.env.LBRY_DAEMON_ACCESS_TOKEN,
metadata: publishMetadata
},
json: true,
method: "PUT",
url: `${process.env.NODE_ENV === "development" ? "http://localhost:5200/publish" : `https://${process.env.DAEMON_URL}/publish` }`
}, (error, response, body) => {
if (error) resolve(error);
resolve(body);
}));