[英]How to run downloaded App Router via Service Marketplace
I downloaded XS_JSCRIPT14_10-70001363
package from Service Marketplace. 我从Service Marketplace下载了XS_JSCRIPT14_10-70001363
软件包。 Please suggest me how to run this App Router Login form with localhost
I am trying with npm start
command, but getting UAA service exception. 请建议我如何使用localhost
运行此App路由器登录表单我正在尝试使用npm start
命令,但获得UAA服务异常。 How to handle from localhost. 如何从localhost处理。
EDIT: Turns out I was incorrect, it is apparently possible to run the approuter locally. 编辑:事实证明我是不正确的,显然可以在本地运行approuter。
First of all, here is the documentation for the approuter: https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/01c5f9ba7d6847aaaf069d153b981b51.html 首先,这里是approuter的文档: https ://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/01c5f9ba7d6847aaaf069d153b981b51.html
As far as I understood, you need to provide to files to the approuter for it to run locally, default-services.json
and default-env.json
(put them in the same directory as your package.json
. 据我所知,您需要向approuter提供文件以使其在本地运行, default-services.json
和default-env.json
(将它们放在与package.json
相同的目录中。
The default-services.json
has a format like this: default-services.json
的格式如下:
{
"uaa": {
"url" : "http://my.uaa.server/",
"clientid" : "client-id",
"clientsecret" : "client-secret",
"xsappname" : "my-business-application"
}
}
The default-env.json
is simply a json file holding the environment variables that the approuter needs to access, like so: default-env.json
只是一个json文件,其中包含approuter需要访问的环境变量,如下所示:
{
"VCAP_SERVICES": <env>,
...
}
Unfortunately, the documentation does not state which variables are required, therefore I cannot provide you with a working example. 不幸的是,文档没有说明需要哪些变量,因此我无法为您提供一个工作示例。
Hope this helps you! 希望这对你有所帮助! Should you manage to get this running, I'm sure others would appreciate if you share your knowledge here. 如果你能在这里分享你的知识,我相信如果你能让这个运行起来,我相信别人会很感激。
When you download the approuter, either via npm
or service marketplace you have to provide two additional files for a basic setup inside the AppRouter directory (besides package.json
, xs-app.json
, etc.). 当您通过npm
或服务市场下载approuter时,您必须为AppRouter目录中的基本设置提供两个额外的文件(除了package.json
, xs-app.json
等)。
The default-services.json
holds the variables that tell the approuter where to find the correct authentication server (eg, XSUAA). default-services.json
保存变量,告诉approuter在哪里找到正确的身份验证服务器(例如,XSUAA)。 You have to provide at least the clientid, clientsecret, and URL of the authorization server as part of this file like this: 您必须至少提供授权服务器的clientid,clientsecret和URL作为此文件的一部分,如下所示:
{
"uaa": {
"url" : "http://my.uaa.server/",
"clientid" : "client-id",
"clientsecret" : "client-secret",
"xsappname" : "my-business-application"
}
}
You can get this parameters, for example, after binding on SAP Cloud Platform, CloudFoundry your application to an (empty) instance of XSUAA where you can retrieve the values via cf env <appname>
from the `VCAP_SERVICES/xsuaa' properties (they have exactly the same property names). 您可以获取此参数,例如,在SAP Cloud Platform上绑定后,将您的应用程序CloudFoundry到XSUAA的(空)实例,您可以通过cf env <appname>
从“VCAP_SERVICES / xsuaa”属性中检索值(它们具有完全相同的属性名称)。
In addition, you require the default-env.json
file which holds at least the destination variable to which backend microservice you want to send the received Json Web Token to. 此外,您需要default-env.json
文件,该文件至少包含要将接收到的Json Web令牌发送到的后端微服务的目标变量。 It may look like this: 它可能看起来像这样:
{
"destinations": [ {
"name": "my-destination", "url": "http://localhost:1234", "forwardAuthToken": true
}]
}
Afterwards, inside the approuter directory you can simply run npm start
which runs the approuter per default under http://localhost:5000
. 然后,在approuter目录中,您可以简单地运行npm start
,默认情况下在http://localhost:5000
下运行approuter。 It also writes nice console output you can use to debug the parameters above. 它还可以编写很好的控制台输出,您可以使用它来调试上面的参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.