projects
/
crowdnode.js
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix(http-rpc): use before init, off by onearg
[crowdnode.js/.git]
/
lib
/
crowdnode.js
diff --git
a/lib/crowdnode.js
b/lib/crowdnode.js
index 0ff758b0f17d288f622c3ef349297b60b6e77c8b..977c022e1d8af2aea2859731168a2626ce4db37c 100644
(file)
--- a/
lib/crowdnode.js
+++ b/
lib/crowdnode.js
@@
-71,6
+71,7
@@
CrowdNode.responses = {
/**
* @param {Object} opts
/**
* @param {Object} opts
+ * @param {String} opts.baseUrl
* @param {String} opts.insightBaseUrl
*/
CrowdNode.init = async function ({ baseUrl, insightBaseUrl }) {
* @param {String} opts.insightBaseUrl
*/
CrowdNode.init = async function ({ baseUrl, insightBaseUrl }) {
@@
-425,7
+426,7
@@
function createApi(tmplUrl) {
return async function () {
/** @type Array<String> */
//@ts-ignore - arguments
return async function () {
/** @type Array<String> */
//@ts-ignore - arguments
- let args = [].slice.call(arguments,
1
);
+ let args = [].slice.call(arguments,
0
);
// ex:
let url = `${CrowdNode._baseUrl}${tmplUrl}`;
// ex:
let url = `${CrowdNode._baseUrl}${tmplUrl}`;
@@
-488,7
+489,11
@@
function parseAddr(prefix, html) {
if (require.main === module) {
(async function main() {
//@ts-ignore
if (require.main === module) {
(async function main() {
//@ts-ignore
- await CrowdNode.init();
+ await CrowdNode.init({
+ //@ts-ignore
+ baseUrl: CrowdNode.main.baseUrl,
+ insightBaseUrl: "https://insight.dash.org",
+ });
console.info(CrowdNode);
})().catch(function (err) {
console.error(err);
console.info(CrowdNode);
})().catch(function (err) {
console.error(err);