Skip to content

Commit

Permalink
Change to alternative node (or your own)
Browse files Browse the repository at this point in the history
```js
(async () => {
    const api = require('skycoin');
    api.options({node: 'http://127.0.0.1:6420/'});
    console.log(await api.version());
})();
```
  • Loading branch information
Jon Eyrick authored Mar 26, 2018
1 parent 9faff18 commit c8932b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions skycoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ module.exports = function() {
'use strict';
const axios = require('axios');
const defaults = {
node: 'https://node.skycoin.net/api/',
proxy: false,
timeout: 5000
timeout: 60000
};
let options = {};
let options = defaults;

async function request(url, data = {}, flags = {}) {
const base = 'https://node.skycoin.net/api/';
const userAgent = 'Mozilla/4.0 (compatible; Node Skycoin API)';
const contentType = 'application/x-www-form-urlencoded';
let headers = {
Expand All @@ -21,7 +21,7 @@ module.exports = function() {
headers: headers,
timeout: options.timeout,
proxy: options.proxy,
baseURL: base
baseURL: options.node
};
if ( typeof flags.method !== 'undefined' ) params.method = flags.method; // GET POST PUT DELETE
if ( params.method == 'GET' ) {
Expand Down

0 comments on commit c8932b9

Please sign in to comment.