2017-02-22 04:11:29 +00:00
|
|
|
const Url = new URL(location.href);
|
2017-02-21 19:19:53 +00:00
|
|
|
|
2017-02-22 04:11:29 +00:00
|
|
|
const isRoot = Url.host.split('.')[0] == 'misskey';
|
2017-02-21 19:19:53 +00:00
|
|
|
|
2017-02-22 04:11:29 +00:00
|
|
|
const host = isRoot ? Url.host : Url.host.substring(Url.host.indexOf('.') + 1, Url.host.length);
|
|
|
|
const scheme = Url.protocol;
|
|
|
|
const url = `${scheme}//${host}`;
|
2017-02-21 19:19:53 +00:00
|
|
|
const apiUrl = `${scheme}//api.${host}`;
|
|
|
|
const devUrl = `${scheme}//dev.${host}`;
|
|
|
|
const aboutUrl = `${scheme}//about.${host}`;
|
|
|
|
|
2017-03-18 11:05:11 +00:00
|
|
|
export default {
|
2017-02-21 19:19:53 +00:00
|
|
|
host,
|
|
|
|
scheme,
|
2017-02-22 04:11:29 +00:00
|
|
|
url,
|
2017-02-21 19:19:53 +00:00
|
|
|
apiUrl,
|
|
|
|
devUrl,
|
2017-02-21 19:25:16 +00:00
|
|
|
aboutUrl
|
2017-02-21 19:19:53 +00:00
|
|
|
};
|