node-envmark-cdn
通过ENVMARK
环境变量去动态取得cdn值,用于解析{$CDN}
下载
npm i @xysfe/node-envmark-cdn
使用方式
const getCdn = require('@xysfe/node-envmark-cdn')
const cdn = getCdn()
如果需要拿到获取cdn的代码,使用方式如下
const getCdn = require('@xysfe/node-envmark-cdn')
const code = getCdn.prototype.codeString()
/*
* code内可用的变量分别为:
* __node_envmarkMap__
* __node_envmark__
* __node_cdn__
*/
映射表
ENVMARK | env | cdn |
---|---|---|
100 | dev | '//sslstatic.xiaoyusan.com' |
200 | idc | '//sslstatic.xiaoyusan.com' |
500 | alpha | '//sslstatic.xiaoyusan.com' |
600 | beta | '//sslstatic.xiaoyusan.com' |
700 | cx-beta | '//sslstatic.cxisc.com' |
800 | cx-idc | '//sslstatic.cxisc.com' |
900 | muc-idc | '//sslstatic.xiaoyusan.com' |
1000 | muc-beta | '//sslstatic.xiaoyusan.com' |