Loopback 3 & Angular 2 generation of /reset-password endpoint unrealiable

时间:2022-11-15 13:18:02

We are building an application that so far has a simple user management implementation. This question relates to the built-in password resetting functionality of Loopback v3. User management is being worked on a model derived from the built-in User, and it is called MyCustomUser

我们正在构建一个到目前为止具有简单用户管理实现的应用程序。此问题与Loopback v3的内置密码重置功能有关。用户管理正在处理从内置用户派生的模型,它被称为MyCustomUser

Each time code changes are pushed into a GitHub repo, we have Jenkins build a Docker container, and inside of it run npm install then lb-sdk (with suitable parameters) then ng build --env=prod and finally node .. After this happens, the application runs normally, BUT:

每次代码更改被推送到GitHub仓库时,我们让Jenkins构建一个Docker容器,并在其中运行npm install然后运行lb-sdk(带有合适的参数)然后ng build --env = prod和finally节点..之后发生了,应用程序正常运行,但是:

  • When performing the same deployment commands locally (on my own linux laptop), the API endpoints /MyCustomUsers/reset and /MyCustomUsers/reset-password are created (i.e. they are visible and manipulable via the Strongloop Explorer)
  • 在本地执行相同的部署命令(在我自己的linux笔记本电脑上)时,会创建API端点/ MyCustomUsers / reset和/ MyCustomUsers / reset-password(即它们可通过Strongloop Explorer查看和操作)
  • When the deployment is run by Jenkins in the Docker container, only one of the two API endpoints is created, /MyCustomUsers/reset. God only knows where the other endpoint, /MyCustomUsers/reset-password, ends up.
  • 当Jenkins在Docker容器中运行部署时,只会创建两个API端点中的一个,即/ MyCustomUsers / reset。上帝只知道另一个端点/ MyCustomUsers / reset-password的最终位置。

Obviously, all deployments are run against the same codebase (i.e. the same commit ID of the GitHub repo). It is bewildering how the service behaves perfectly on localhost but not on the cloud-based docker container.

显然,所有部署都是针对相同的代码库运行的(即GitHub repo的相同提交ID)。令人困惑的是服务如何在localhost上完美运行,而不是在基于云的docker容器上运行。

2 个解决方案

#1


0  

Sounds like you are running two different versions of the Loopback-Angular2-SDK. From what I've understood the SDK for Angular2 is still in heavy beta and not yet ready for production. However this doesn't excuse the difference, but it really sounds like two different versions.

听起来你正在运行两个不同版本的Loopback-Angular2-SDK。据我所知,Angular2的SDK仍然处于严峻的测试阶段,尚未准备好投入生产。然而,这并不能解释这种差异,但它听起来真的是两个不同的版本。

We are using the same build-flow as you, are your package.json identical when it comes to @mean-expert/loopback-sdk-builder?

我们正在使用与您相同的构建流程,当涉及到@ mean-expert / loopback-sdk-builder时,您的package.json是否相同?

The guys working with the SDK-generator are really good at responding in their issue-section, would recommend asking there otherwise.

使用SDK生成器的人非常善于在他们的问题部分做出回应,建议不要在那里问。

#2


0  

It turns out that the remote docker was running node 6.9.2 and npm 3.10.9, whereas I was running node 6.10.3 and npm 3.10.10. After making the docker instance run the same versions as I had locally and deploying the package.json along with its npm-shrinkwrap.json, the endpoint was correctly generated.

事实证明,远程docker正在运行节点6.9.2和npm 3.10.9,而我正在运行节点6.10.3和npm 3.10.10。在使docker实例运行与本地版本相同的版本并部署package.json及其npm-shrinkwrap.json之后,正确生成了端点。

#1


0  

Sounds like you are running two different versions of the Loopback-Angular2-SDK. From what I've understood the SDK for Angular2 is still in heavy beta and not yet ready for production. However this doesn't excuse the difference, but it really sounds like two different versions.

听起来你正在运行两个不同版本的Loopback-Angular2-SDK。据我所知,Angular2的SDK仍然处于严峻的测试阶段,尚未准备好投入生产。然而,这并不能解释这种差异,但它听起来真的是两个不同的版本。

We are using the same build-flow as you, are your package.json identical when it comes to @mean-expert/loopback-sdk-builder?

我们正在使用与您相同的构建流程,当涉及到@ mean-expert / loopback-sdk-builder时,您的package.json是否相同?

The guys working with the SDK-generator are really good at responding in their issue-section, would recommend asking there otherwise.

使用SDK生成器的人非常善于在他们的问题部分做出回应,建议不要在那里问。

#2


0  

It turns out that the remote docker was running node 6.9.2 and npm 3.10.9, whereas I was running node 6.10.3 and npm 3.10.10. After making the docker instance run the same versions as I had locally and deploying the package.json along with its npm-shrinkwrap.json, the endpoint was correctly generated.

事实证明,远程docker正在运行节点6.9.2和npm 3.10.9,而我正在运行节点6.10.3和npm 3.10.10。在使docker实例运行与本地版本相同的版本并部署package.json及其npm-shrinkwrap.json之后,正确生成了端点。