Commit c9961947f962c4a49754de9909ef295f48fe92a1
1 parent
33a985c1
update production api url
Showing
2 changed files
with
5 additions
and
5 deletions
front-end/h5/src/constants/api.js
| 1 | -// export const API_HOST = 'https://radiant-depths-79548.herokuapp.com' | |
| 2 | -// export const API_PORT = '' | |
| 3 | -// export const API_ORIGIN = `${API_HOST}:${API_PORT}` | |
| 4 | -export const API_ORIGIN = 'http://localhost:1337' | |
| 1 | +export const API_ORIGIN = process.env.NODE_ENV === 'production' ? 'https://luban-h5-api.herokuapp.com' : 'http://localhost:1337' // for local dev | ... | ... |
front-end/h5/vue.config.js
| 1 | 1 | // const ProxyAgent = require('proxy-agent') |
| 2 | 2 | const isProd = process.env.NODE_ENV === 'production' |
| 3 | 3 | |
| 4 | -const PROD_API_ORIGIN = 'https://radiant-depths-79548.herokuapp.com' | |
| 4 | +const PROD_API_ORIGIN = 'https://luban-h5-api.herokuapp.com' | |
| 5 | 5 | const DEV_API_ORIGIN = 'http://localhost:1337' |
| 6 | +// const DEV_API_ORIGIN = 'https://luban-h5-api.herokuapp.com' | |
| 6 | 7 | |
| 7 | 8 | module.exports = { |
| 8 | 9 | runtimeCompiler: true, |
| 10 | + // 因为需要部署到 github pages,所以需要将 publicPath 设为 "/< GitHub Repo Name>/" | |
| 9 | 11 | publicPath: isProd ? '/luban-h5/' : '/', |
| 12 | + productionSourceMap: false, | |
| 10 | 13 | devServer: { |
| 11 | 14 | // proxy: API_ORIGIN |
| 12 | 15 | proxy: { | ... | ... |