config/grailed_config.js

122 lines
3.0 KiB
JavaScript

/**
* 部署多端的一些Map
*/
// 与域名相关的配置
export const HOST_MAP = {
DEFAULT: {
lang: 'uk-gb',
urlProtocol: 'https://',
wsProtocol: 'wss://',
host: 'www.aworldtrade.shop',
appContextPath: '/app-api',
adminContextPath: '/admin-api',
chatUrl: 'https://chat.aworldtrade.shop',
},
'10.0.128.2': {
lang: 'uk-gb',
urlProtocol: 'http://',
wsProtocol: 'ws://',
host: '110.0.128.15:48080',
appContextPath: '/app-api',
adminContextPath: '/admin-api',
chatUrl: 'https://chat.aworldtrade.shop',
},
'localhost': {
lang: 'uk-gb',
urlProtocol: 'http://',
wsProtocol: 'ws://',
host: '10.0.128.15:48080',
appContextPath: '/app-api',
adminContextPath: '/admin-api',
chatUrl: 'https://chat.aworldtrade.shop',
},
'www.aworldtrade.shop': {
lang: 'uk-gb',
urlProtocol: 'https://',
wsProtocol: 'ws://',
host: 'www.aworldtrade.shop',
appContextPath: '/app-api',
adminContextPath: '/admin-api',
chatUrl: 'https://chat.aworldtrade.shop',
},
'backend.aworldtrade.shop': {
lang: 'uk-gb',
urlProtocol: 'https://',
wsProtocol: 'ws://',
host: 'backend.aworldtrade.shop',
appContextPath: '/app-api',
adminContextPath: '/admin-api',
chatUrl: 'https://chat.aworldtrade.shop',
},
'appflyer.wiki': {
lang: 'uk-gb',
urlProtocol: 'https://',
wsProtocol: 'wss://',
host: 'www.aworldtrade.shop',
appContextPath: '/app-api',
adminContextPath: '/admin-api',
chatUrl: 'https://chat.aworldtrade.shop',
},
'new1-www.appsflyer.wiki': {
lang: 'uk-gb',
urlProtocol: 'https://',
wsProtocol: 'wss://',
host: 'new1-www.appsflyer.wiki',
appContextPath: '/app-api',
adminContextPath: '/admin-api',
chatUrl: 'https://new1-chat.appsflyer.wiki',
},
'www.appsflyer.wiki': {
lang: 'uk-gb',
urlProtocol: 'https://',
wsProtocol: 'wss://',
host: 'www.appsflyer.wiki',
appContextPath: '/app-api',
adminContextPath: '/admin-api',
chatUrl: 'https://chat.appsflyer.wiki',
},
'www.ottoshop.wiki': {
lang: 'tl-tl',
urlProtocol: 'https://',
wsProtocol: 'wss://',
host: 'www.ottoshop.wiki',
appContextPath: '/app-api',
adminContextPath: '/admin-api',
chatUrl: 'https://chat.ottoshop.wiki',
},
}
// 多域名使用同一个配置
function addConfigWithMultipleDomain(lang, mainDomain) {
for (let subDomain of ['www', 'chat', 'service', 'backend']) {
const domain = subDomain + '.' + mainDomain
HOST_MAP[domain] = {
// 共同部分
lang,
urlProtocol: 'https://',
wsProtocol: 'wss://',
appContextPath: '/app-api',
adminContextPath: '/admin-api',
// -----
host: 'www.' + mainDomain,
chatUrl: 'https://chat.' + mainDomain,
}
}
}
// e.g.
addConfigWithMultipleDomain('it-it', 'aworldtrade.shop')
addConfigWithMultipleDomain('fr-fr', 'sharelocalmedia.cc')
addConfigWithMultipleDomain('it-it', 'hood-de.cc')
addConfigWithMultipleDomain('es-es', 'sharelocalmedia.wiki')
addConfigWithMultipleDomain('fr-fr', 'shoparizefr.com')