代理通过在 elm-package.json 中设置停止在生产服务器上工作
Proxy stops working on the production server by setting it in the elm-package.json
I'm using create-elm-app webpack for my ELM project.
And use a proxy by setting it in the elm-package.json
and this is
working fine only on the dev server. When I created build by using
elm-app build
then proxy stops working on the production server. Can
anyone please suggest me any solution to resolve this.
这是我的 elm-package.json
{
"proxy": "https://some.domain.net/",
"version": "1.0.0",
"summary": "helpful summary of your project, less than 80 characters",
"repository": "https://github.com/user/project.git",
"license": "BSD3",
"source-directories": [
"src"
],
"exposed-modules": [],
"dependencies": {
"NoRedInk/elm-decode-pipeline": "3.0.0 <= v < 4.0.0",
"elm-community/list-extra": "7.1.0 <= v < 8.0.0",
"elm-community/typed-svg": "2.0.0 <= v < 3.0.0",
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-lang/html": "2.0.0 <= v < 4.0.1",
"elm-lang/http": "1.0.0 <= v < 2.0.0",
"elm-lang/navigation": "2.1.0 <= v < 3.0.0",
"evancz/url-parser": "2.0.1 <= v < 3.0.0",
"krisajenkins/remotedata": "4.3.3 <= v < 5.0.0"
},
"elm-version": "0.18.0 <= v < 0.19.0"
}
这是设计使然。代理仅用于帮助开发,因此您可以将请求转发到其他地方的服务器。这使您不必在前端开发期间在本地 运行 一个 API 服务器。它模拟了 Elm 应用程序和 API 服务器从同一主机和端口提供服务的环境。
More info on the Webpack devServer
can be found here.
当您为生产构建时,代理概念被移除,因为您将从同一主机和端口为 Elm 应用程序和 API 后端提供服务。
I'm using create-elm-app webpack for my ELM project. And use a proxy by setting it in the
elm-package.json
and this is working fine only on the dev server. When I created build by usingelm-app build
then proxy stops working on the production server. Can anyone please suggest me any solution to resolve this.
这是我的 elm-package.json
{
"proxy": "https://some.domain.net/",
"version": "1.0.0",
"summary": "helpful summary of your project, less than 80 characters",
"repository": "https://github.com/user/project.git",
"license": "BSD3",
"source-directories": [
"src"
],
"exposed-modules": [],
"dependencies": {
"NoRedInk/elm-decode-pipeline": "3.0.0 <= v < 4.0.0",
"elm-community/list-extra": "7.1.0 <= v < 8.0.0",
"elm-community/typed-svg": "2.0.0 <= v < 3.0.0",
"elm-lang/core": "5.0.0 <= v < 6.0.0",
"elm-lang/html": "2.0.0 <= v < 4.0.1",
"elm-lang/http": "1.0.0 <= v < 2.0.0",
"elm-lang/navigation": "2.1.0 <= v < 3.0.0",
"evancz/url-parser": "2.0.1 <= v < 3.0.0",
"krisajenkins/remotedata": "4.3.3 <= v < 5.0.0"
},
"elm-version": "0.18.0 <= v < 0.19.0"
}
这是设计使然。代理仅用于帮助开发,因此您可以将请求转发到其他地方的服务器。这使您不必在前端开发期间在本地 运行 一个 API 服务器。它模拟了 Elm 应用程序和 API 服务器从同一主机和端口提供服务的环境。
More info on the Webpack devServer
can be found here.
当您为生产构建时,代理概念被移除,因为您将从同一主机和端口为 Elm 应用程序和 API 后端提供服务。