【发布时间】:2017-10-04 10:27:04
【问题描述】:
我尝试将我的“http://localhost:3000/api/”路径重定向到在 apache 服务器中运行的“http://example.com/api/”。
这是我的 devServer 配置:
devServer: {
publicPath: '/build/',
port: 3000,
proxy: {
'/api': {
target: 'http://gestios.loc/api'
}
},
historyApiFallback: true
}
当我尝试访问 http://localhost:3000/api/calltek/apps?permalink=empresas 时收到 404 错误。
Request URL:http://localhost:3000/api/calltek/apps?permalink=empresas
Request Method:GET
Status Code:404 Not Found
Remote Address:127.0.0.1:3000
Referrer Policy:no-referrer-when-downgrade
HTTP/1.1 404 Not Found
X-Powered-By: Express
date: Fri, 05 May 2017 18:13:42 GMT
server: Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.28
vary: accept-language,accept-charset
accept-ranges: bytes
connection: close
transfer-encoding: chunked
content-type: text/html
content-language: es
【问题讨论】:
标签: javascript angularjs apache webpack webpack-dev-server