2017-02-22 06:11:29 +02:00
|
|
|
const Url = new URL(location.href);
|
2017-02-21 21:19:53 +02:00
|
|
|
|
2017-02-22 06:11:29 +02:00
|
|
|
const isRoot = Url.host.split('.')[0] == 'misskey';
|
2017-02-21 21:19:53 +02:00
|
|
|
|
2017-02-22 06:11:29 +02: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 21:19:53 +02:00
|
|
|
const apiUrl = `${scheme}//api.${host}`;
|
2017-10-31 20:17:14 +02:00
|
|
|
const chUrl = `${scheme}//ch.${host}`;
|
2017-02-21 21:19:53 +02:00
|
|
|
const devUrl = `${scheme}//dev.${host}`;
|
|
|
|
const aboutUrl = `${scheme}//about.${host}`;
|
2017-08-12 09:17:03 +03:00
|
|
|
const statsUrl = `${scheme}//stats.${host}`;
|
2017-08-11 17:57:16 +03:00
|
|
|
const statusUrl = `${scheme}//status.${host}`;
|
2017-02-21 21:19:53 +02:00
|
|
|
|
2017-03-18 13:05:11 +02:00
|
|
|
export default {
|
2017-02-21 21:19:53 +02:00
|
|
|
host,
|
|
|
|
scheme,
|
2017-02-22 06:11:29 +02:00
|
|
|
url,
|
2017-02-21 21:19:53 +02:00
|
|
|
apiUrl,
|
2017-10-31 20:17:14 +02:00
|
|
|
chUrl,
|
2017-02-21 21:19:53 +02:00
|
|
|
devUrl,
|
2017-08-11 17:57:16 +03:00
|
|
|
aboutUrl,
|
2017-08-12 09:17:03 +03:00
|
|
|
statsUrl,
|
2017-08-11 17:57:16 +03:00
|
|
|
statusUrl
|
2017-02-21 21:19:53 +02:00
|
|
|
};
|