summaryrefslogtreecommitdiff
path: root/src/web/app/common/scripts/config.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-11-21 03:40:09 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-11-21 03:40:09 +0900
commit1436617aab030fa5b3760a3eeae37a1cdeeba2df (patch)
tree5ac701a811de8be79e8e83643752818ee4b2cd1d /src/web/app/common/scripts/config.ts
parentv3165 (diff)
downloadsharkey-1436617aab030fa5b3760a3eeae37a1cdeeba2df.tar.gz
sharkey-1436617aab030fa5b3760a3eeae37a1cdeeba2df.tar.bz2
sharkey-1436617aab030fa5b3760a3eeae37a1cdeeba2df.zip
wip
Diffstat (limited to 'src/web/app/common/scripts/config.ts')
-rw-r--r--src/web/app/common/scripts/config.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/web/app/common/scripts/config.ts b/src/web/app/common/scripts/config.ts
index c5015622f0..b4801a44de 100644
--- a/src/web/app/common/scripts/config.ts
+++ b/src/web/app/common/scripts/config.ts
@@ -1,9 +1,11 @@
-const Url = new URL(location.href);
+const _url = new URL(location.href);
-const isRoot = Url.host.split('.')[0] == 'misskey';
+const isRoot = _url.host == 'localhost'
+ ? true
+ : _url.host.split('.')[0] == 'misskey';
-const host = isRoot ? Url.host : Url.host.substring(Url.host.indexOf('.') + 1, Url.host.length);
-const scheme = Url.protocol;
+const host = isRoot ? _url.host : _url.host.substring(_url.host.indexOf('.') + 1, _url.host.length);
+const scheme = _url.protocol;
const url = `${scheme}//${host}`;
const apiUrl = `${scheme}//api.${host}`;
const chUrl = `${scheme}//ch.${host}`;