1.0.2 • Published 5 years ago

test-apiurl v1.0.2

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago
#转换URL地址,用于统一指向测试环境

 stepA 
    引用 test-apiurl
 stepB 
    调用TURL 方法
        返回修改后的URL地址
        该方法提供三个参数
    
        * @param {URL} url 当前需要请求的地址 
        * @param {string} mark 需要标记的前缀,如果不设置,默认: test_
        * @param {string} envName 当前环境变量的变量名称,不填默认: JMG_ENV
例如:
    let u= require("test-apiurl")

    u.TURL("www.baidu.com") => http://test_www.baidu.com (默认使用:http://)
    u.TURL("https://www.baidu.com","testingenvironment") => https://testingenvironmentwww.baidu.com
    u.TURL("http://www.baidu.com","testing") => http://testingwww.baidu.com

    当在生产环境中(express,vue-cli) 中打包后,会自动去除前缀