用API接口 怎么在线上测试 需要先打包么 能只打包想测试的页面么
来源:6-2 首页 - 信息列表 - 全部产品

慕慕3508673
2017-05-30
下载了依赖后感觉太大了 项目需要线上测试 想问一下用什么方法好
2回答
-
慕慕3508673
提问者
2017-05-31
这些文件里全部都要给后台么
012017-05-31 -
fishenal
2017-05-30
就本地把代理连到线上地址就行了,现在如果开启了8081是把/api 代理到8081服务,线上的话就改成 111.111.111.111/api这样一个地址。
以上是你自己本地测试的情况,假如要提供环境给团队其他人用,可以直接在服务器上部署npm run dev,同样要把代理写对。
代理是在 config/index.js
dev: {
env: require('./dev.env'),
port: 8888,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api': 'http://localhost:8889'
},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
}
012017-05-31
相似问题