commit 91535841d6ea9a96aad69f8d2898adb0bc883e46 Author: Huang Jin <1603612708@qq.com> Date: Tue Jan 2 22:19:19 2024 +0800 init diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/grailed_config.js b/grailed_config.js new file mode 100644 index 0000000..796ad43 --- /dev/null +++ b/grailed_config.js @@ -0,0 +1,93 @@ +/** + * 部署多端的一些Map + */ + +// 与域名相关的配置 +export const HOST_MAP = { + DEFAULT: { + lang: 'uk-gb', + urlProtocol: 'https://', + wsProtocol: 'wss://', + host: 'www.eworldtrade.shop', + appContextPath: '/app-api', + adminContextPath: '/admin-api', + chatUrl: 'https://chat.eworldtrade.shop', + }, + + '192.168.0.127': { + lang: 'uk-gb', + urlProtocol: 'http://', + wsProtocol: 'ws://', + host: '192.168.0.127:48080', + appContextPath: '/app-api', + adminContextPath: '/admin-api', + chatUrl: 'https://chat.eworldtrade.shop', + }, + + 'localhost': { + lang: 'uk-gb', + urlProtocol: 'http://', + wsProtocol: 'ws://', + host: 'localhost:48080', + appContextPath: '/app-api', + adminContextPath: '/admin-api', + chatUrl: 'https://chat.eworldtrade.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', 'veepee-it.com') + +addConfigWithMultipleDomain('fr-fr', 'sharelocalmedia.cc') +addConfigWithMultipleDomain('it-it', 'hood-de.cc') +addConfigWithMultipleDomain('es-es', 'sharelocalmedia.vip') +