misskey/src/web/app/common/scripts/config.ts

26 lines
610 B
TypeScript
Raw Normal View History

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