[Client] Fix bug: Add missing config property (url)

This commit is contained in:
syuilo 2017-02-22 13:11:29 +09:00
parent 1f88c4d40c
commit d2182c1705
1 changed files with 6 additions and 4 deletions

View File

@ -1,9 +1,10 @@
const url = new URL(location.href); const Url = new URL(location.href);
const isRoot = url.host.split('.')[0] == 'misskey'; const isRoot = Url.host.split('.')[0] == 'misskey';
const host = isRoot ? url.host : url.host.substring(url.host.indexOf('.') + 1, url.host.length); const host = isRoot ? Url.host : Url.host.substring(Url.host.indexOf('.') + 1, Url.host.length);
const scheme = url.protocol; const scheme = Url.protocol;
const url = `${scheme}//${host}`;
const apiUrl = `${scheme}//api.${host}`; const apiUrl = `${scheme}//api.${host}`;
const devUrl = `${scheme}//dev.${host}`; const devUrl = `${scheme}//dev.${host}`;
const aboutUrl = `${scheme}//about.${host}`; const aboutUrl = `${scheme}//about.${host}`;
@ -11,6 +12,7 @@ const aboutUrl = `${scheme}//about.${host}`;
module.exports = { module.exports = {
host, host,
scheme, scheme,
url,
apiUrl, apiUrl,
devUrl, devUrl,
aboutUrl aboutUrl