From 34da7fcc07b7c7f0794017595d75d4f1c5811c83 Mon Sep 17 00:00:00 2001 From: Enrico Fasoli Date: Wed, 23 Dec 2015 18:55:04 +0100 Subject: [PATCH] use gateway api by default --- webapp/components/options.jsx | 4 +++- webapp/pages/settings.jsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/webapp/components/options.jsx b/webapp/components/options.jsx index 162e928..3d3e43a 100644 --- a/webapp/components/options.jsx +++ b/webapp/components/options.jsx @@ -7,7 +7,9 @@ module.exports = { } catch (e) { // Do nothing } - if (opt === null || opt === undefined) opt = { addr: 'localhost', port: 5001 } + if (opt === null || opt === undefined) { + opt = { addr: window.location.hostname, port: window.location.port } + } return opt } } diff --git a/webapp/pages/settings.jsx b/webapp/pages/settings.jsx index 13d164a..e15c6b9 100644 --- a/webapp/pages/settings.jsx +++ b/webapp/pages/settings.jsx @@ -4,7 +4,7 @@ var Icon = require('icon.jsx') module.exports = function (boardsAPI) { return React.createClass({ getDefaults: function () { - return { addr: 'localhost', port: 5001, api: false } + return { addr: window.location.hostname, port: window.location.port, api: false } }, getInitialState: function () { var s = window.localStorage.getItem('ipfs-boards-settings')