gpt4 book ai didi

代理通过在 elm-package.json 中设置停止在生产服务器上工作

转载 作者:行者123 更新时间:2023-12-01 09:50:36 26 4
gpt4 key购买 nike

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 后端提供服务。

关于代理通过在 elm-package.json 中设置停止在生产服务器上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50406003/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com