带有Html5 App Repo和Approuter的Cloud Foundry上的MTA

2020-08-15 17:44发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)嗨,SAP! 我正在尝试使...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


嗨,SAP!

我正在尝试使用 nodejs html5模块在云铸造厂上构建全栈应用。 我首先创建了一个没有html5应用程序回购的 MTA ,并且效果很好(特别是路由,这个问题将要解决的问题)。 然后,我创建了一个带有html5应用程序仓库的 MTA (在创建html5模块时选中了该复选框)以利用它,现在路由到我的nodejs-backend-module不再起作用。 总是存在内部服务器错误。

我已经在sap帮助站点上阅读到,当使用html5 app repo和approuter时,不支持属性" destination"(我在没有html5 app repo的mta中具有将请求转发到模块的属性)。 那么我该如何将请求转发到后端模块?

以下显示了具有到html5应用程序仓库的路由的approuter。 当我添加带有目的地的第二条路线时,它不再起作用。

 {
 " welcomeFile":"/index.html",
 " authenticationMethod":"路由",
 "登出": {
 " logoutEndpoint":"/img/do/logout"
 },
 "路线":[{
 " source":" ^/(。*)$",
 " target":" $ 1",
 " service":" html5-apps-repo-rt",
 " authenticationType":" xsuaa"

         },{//无效的部分
 " source":" ^/api/([[a-z] +)",
 " target":"/img/$ 1",
 "目标":" nodejs_repo_api"
 }
 ]
 }
 

这是mta.yaml文件:

 ID:mta_test_modules_repo
 _schema-version:" 2.1"
 参数:
   deploy_mode:html5-repo
 版本:0.0.1
 模块:
   -名称:mta_test_modules_repo_appRouter
     类型:approuter.nodejs
     路径:mta_test_modules_repo_appRouter
     参数:
       磁盘配额:256M
       记忆体:256M
     要求:
       -名称:mta_test_modules_repo_html5_repo_runtime
       -名称:uaa_mta_test_modules_repo

   -名称:mta_test_modules_repo_ui_deployer
     类型:com.sap.html5.application-content
     路径:mta_test_modules_repo_ui_deployer
     要求:
       -名称:mta_test_modules_repo_html5_repo_host
     构建参数:
       要求:
         -名称:destination_service_frontend
           工件:
             -'./*'
           目标路径:resources/destination_service_frontend

   -名称:nodejs_repo
     类型:nodejs
     路径:nodejs_repo
     提供:
       -名称:nodejs_repo_api
         特性:
           网址:" $ {default-url}"
     
   -名称:destination_service_frontend
     类型:html5
     路径:destination_service_frontend
     参数:
       磁盘配额:500M
       内存:500M
     构建参数:
       制造商:咕unt声
     要求:
       -名称:nodejs_repo_api
         组:目的地
         特性:
           名称:nodejs_repo_api
           网址:"〜{url}"
           forwardAuthToken:true
       -名称:uaa_mta_test_modules_repo
 
 资源:
   -名称:mta_test_modules_repo_html5_repo_runtime
     参数:
       服务计划:应用程序运行时
       服务:html5-apps-repo
     类型:org.cloudfoundry.managed-service

   -名称:mta_test_modules_repo_html5_repo_host
     参数:
       服务计划:应用托管
       服务:html5-apps-repo
     类型:org.cloudfoundry.managed-service

   -名称:uaa_mta_test_modules_repo
     参数:
       路径:./xs-security.json
       服务计划:应用
       服务:xsuaa
     类型:org.cloudfoundry.managed-service

   -名称:dest_mta_test_modules_repo
     参数:
       服务计划:精简版
       服务:目的地
     类型:org.cloudfoundry.managed-service