Sharkey/src/web/app/common/scripts/config.js

22 lines
507 B
JavaScript
Raw Normal View History

const Url = new URL(location.href);
2017-02-21 21:19:53 +02:00
const isRoot = Url.host.split('.')[0] == 'misskey';
2017-02-21 21:19:53 +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}`;
const devUrl = `${scheme}//dev.${host}`;
const aboutUrl = `${scheme}//about.${host}`;
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,
url,
2017-02-21 21:19:53 +02:00
apiUrl,
devUrl,
aboutUrl,
statusUrl
2017-02-21 21:19:53 +02:00
};