如何通过Service Marketplace运行下载的App Router [英] How to run downloaded App Router via Service Marketplace

查看:87
本文介绍了如何通过Service Marketplace运行下载的App Router的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从Service Marketplace下载了XS_JSCRIPT14_10-70001363程序包. 请建议我如何使用localhost运行此应用路由器登录"表单 我正在尝试使用npm start命令,但收到UAA服务异常.如何从本地主机处理.

I downloaded XS_JSCRIPT14_10-70001363 package from Service Marketplace. Please suggest me how to run this App Router Login form with localhost I am trying with npm startcommand, but getting UAA service exception. How to handle from localhost.

推荐答案

当通过npm或服务市场下载approuter时,您必须为AppRouter目录(除了xs-app.json等).

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.).

default-services.json包含一些变量,这些变量告诉approuter在哪里可以找到正确的身份验证服务器(例如XSUAA).您必须至少提供授权服务器的clientid,clientsecret和URL作为该文件的一部分,如下所示:

The default-services.json holds the variables that tell the approuter where to find the correct authentication server (e.g., XSUAA). You have to provide at least the clientid, clientsecret, and URL of the authorization server as part of this file like this:

{
  "uaa": {
    "url" : "http://my.uaa.server/",
    "clientid" : "client-id",
    "clientsecret" : "client-secret",
    "xsappname" : "my-business-application"
  }
}

您可以获取此参数,例如,在SAP Cloud Platform上绑定之后,CloudFoundry将您的应用程序绑定到XSUAA的(空)实例,您可以在其中通过cf env <appname>从`VCAP_SERVICES/xsuaa'属性中检索值(它们具有完全相同的属性名称.

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).

此外,您需要default-env.json文件,该文件至少包含要将接收到的Json Web令牌发送到的后端微服务的目标变量.可能看起来像这样:

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. It may look like this:

{
  "destinations": [ { 
      "name": "my-destination", "url": "http://localhost:1234", "forwardAuthToken": true 
  }]
}

然后,在approuter目录中,您可以简单地运行npm start,该目录默认在http://localhost:5000下运行approuter.它还编写了不错的控制台输出,可用于调试上面的参数.

Afterwards, inside the approuter directory you can simply run npm start which runs the approuter per default under http://localhost:5000. It also writes nice console output you can use to debug the parameters above.

这篇关于如何通过Service Marketplace运行下载的App Router的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆