├── .gitignore ├── CODEOWNERS ├── LICENSE ├── LICENSES └── Apache-2.0.txt ├── README.md ├── REUSE.toml ├── managed-html5-runtime-basic-mta ├── HTML5Module │ ├── index.html │ ├── manifest.json │ ├── package.json │ └── xs-app.json ├── diagram.png ├── mta.yaml ├── package.json ├── readme.md ├── result.png └── xs-security.json ├── managed-html5-runtime-fiori-launchpad-mta ├── HTML5Module │ ├── Component.js │ ├── index.html │ ├── manifest.json │ ├── package.json │ └── xs-app.json ├── HTML5Module1.png ├── contentExplorer.png ├── destination.json ├── diagram.png ├── mta.yaml ├── package.json ├── readme.md └── xs-security.json ├── managed-html5-runtime-jwt-kyma ├── README.md ├── backend │ ├── Dockerfile │ ├── backend.js │ └── package.json ├── deployer │ ├── .dockerignore │ ├── Dockerfile │ ├── package.json │ └── resources │ │ └── webapp │ │ ├── index.html │ │ ├── logout-page.html │ │ ├── manifest.json │ │ └── xs-app.json ├── deployment.yaml ├── diagram.png ├── instanceId.png └── result.png ├── optional-self-hosted-backend ├── .cdsrc.json ├── .gitignore ├── README.md ├── db │ ├── data │ │ └── my.northwind-Products.csv │ ├── schema.cds │ ├── src │ │ └── .hdiconfig │ └── undeploy.json ├── mta.yaml ├── package.json └── srv │ └── service.cds ├── standalone-approuter-html5-local-dir ├── diagram.png ├── package.json ├── readme.md ├── result.png ├── webapp │ └── index.html └── xs-app.json ├── standalone-approuter-html5-mta-ui5webcomponents ├── approuter │ ├── package.json │ └── xs-app.json ├── diagram.png ├── mta.yaml ├── package.json ├── readme.md ├── result.png ├── ui5webcomponents │ ├── index.html │ ├── package.json │ ├── public │ │ ├── manifest.json │ │ └── xs-app.json │ └── src │ │ └── index.js └── xs-security.json ├── standalone-approuter-html5-runtime-mta-hello-world ├── HTML5Module │ ├── index.html │ ├── manifest.json │ ├── package.json │ └── xs-app.json ├── diagram.png ├── mta.yaml ├── package.json ├── readme.md ├── result.png ├── router │ ├── package.json │ └── xs-app.json └── xs-security.json ├── standalone-approuter-html5-runtime ├── HTML5Module │ ├── index.html │ ├── manifest.json │ ├── package.json │ └── xs-app.json ├── diagram.png ├── mta.yaml ├── package.json ├── readme.md ├── result.png └── router │ ├── package.json │ └── xs-app.json ├── standalone-mtx-approuter ├── HTML5Module │ ├── index.html │ ├── logout.html │ ├── manifest.json │ ├── package.json │ └── xs-app.json ├── diagram.png ├── mta.yaml ├── package.json ├── readme.md ├── result.png └── router │ ├── extended-server.js │ ├── package.json │ └── xs-app.json ├── standalone-portal-keyuser-mta ├── deployer │ ├── readme.md │ └── resources │ │ └── uimodule.zip ├── diagram.png ├── launchpad │ └── portal-site │ │ ├── CommonDataModel.json │ │ └── i18n │ │ └── i18n.properties ├── mta.yaml ├── package.json ├── readme.md ├── result1.png ├── result2.png ├── router │ ├── package.json │ ├── readme.md │ └── xs-app.json └── xs-security.json └── standalone-portal-mta ├── deployer ├── readme.md └── resources │ └── uimodule.zip ├── diagram.png ├── launchpad └── portal-site │ ├── CommonDataModel.json │ └── i18n │ └── i18n.properties ├── mta.yaml ├── package.json ├── readme.md ├── result.png ├── router ├── package.json └── xs-app.json └── xs-security.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.mtar 2 | node_modules 3 | */yarn.lock 4 | package-lock.json 5 | dist/ 6 | deployer/resources/ 7 | mta_archives 8 | *.zip 9 | resources/ 10 | 11 | diagrams/ 12 | *.pptx 13 | sap-btp-icon-collection/ 14 | .DS_Store -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * nicolai.schoenteich@sap.com 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSES/Apache-2.0.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | 3 | Version 2.0, January 2004 4 | 5 | http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, 6 | AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | 11 | 12 | "License" shall mean the terms and conditions for use, reproduction, and distribution 13 | as defined by Sections 1 through 9 of this document. 14 | 15 | 16 | 17 | "Licensor" shall mean the copyright owner or entity authorized by the copyright 18 | owner that is granting the License. 19 | 20 | 21 | 22 | "Legal Entity" shall mean the union of the acting entity and all other entities 23 | that control, are controlled by, or are under common control with that entity. 24 | For the purposes of this definition, "control" means (i) the power, direct 25 | or indirect, to cause the direction or management of such entity, whether 26 | by contract or otherwise, or (ii) ownership of fifty percent (50%) or more 27 | of the outstanding shares, or (iii) beneficial ownership of such entity. 28 | 29 | 30 | 31 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions 32 | granted by this License. 33 | 34 | 35 | 36 | "Source" form shall mean the preferred form for making modifications, including 37 | but not limited to software source code, documentation source, and configuration 38 | files. 39 | 40 | 41 | 42 | "Object" form shall mean any form resulting from mechanical transformation 43 | or translation of a Source form, including but not limited to compiled object 44 | code, generated documentation, and conversions to other media types. 45 | 46 | 47 | 48 | "Work" shall mean the work of authorship, whether in Source or Object form, 49 | made available under the License, as indicated by a copyright notice that 50 | is included in or attached to the work (an example is provided in the Appendix 51 | below). 52 | 53 | 54 | 55 | "Derivative Works" shall mean any work, whether in Source or Object form, 56 | that is based on (or derived from) the Work and for which the editorial revisions, 57 | annotations, elaborations, or other modifications represent, as a whole, an 58 | original work of authorship. For the purposes of this License, Derivative 59 | Works shall not include works that remain separable from, or merely link (or 60 | bind by name) to the interfaces of, the Work and Derivative Works thereof. 61 | 62 | 63 | 64 | "Contribution" shall mean any work of authorship, including the original version 65 | of the Work and any modifications or additions to that Work or Derivative 66 | Works thereof, that is intentionally submitted to Licensor for inclusion in 67 | the Work by the copyright owner or by an individual or Legal Entity authorized 68 | to submit on behalf of the copyright owner. For the purposes of this definition, 69 | "submitted" means any form of electronic, verbal, or written communication 70 | sent to the Licensor or its representatives, including but not limited to 71 | communication on electronic mailing lists, source code control systems, and 72 | issue tracking systems that are managed by, or on behalf of, the Licensor 73 | for the purpose of discussing and improving the Work, but excluding communication 74 | that is conspicuously marked or otherwise designated in writing by the copyright 75 | owner as "Not a Contribution." 76 | 77 | 78 | 79 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf 80 | of whom a Contribution has been received by Licensor and subsequently incorporated 81 | within the Work. 82 | 83 | 2. Grant of Copyright License. Subject to the terms and conditions of this 84 | License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, 85 | no-charge, royalty-free, irrevocable copyright license to reproduce, prepare 86 | Derivative Works of, publicly display, publicly perform, sublicense, and distribute 87 | the Work and such Derivative Works in Source or Object form. 88 | 89 | 3. Grant of Patent License. Subject to the terms and conditions of this License, 90 | each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, 91 | no-charge, royalty-free, irrevocable (except as stated in this section) patent 92 | license to make, have made, use, offer to sell, sell, import, and otherwise 93 | transfer the Work, where such license applies only to those patent claims 94 | licensable by such Contributor that are necessarily infringed by their Contribution(s) 95 | alone or by combination of their Contribution(s) with the Work to which such 96 | Contribution(s) was submitted. If You institute patent litigation against 97 | any entity (including a cross-claim or counterclaim in a lawsuit) alleging 98 | that the Work or a Contribution incorporated within the Work constitutes direct 99 | or contributory patent infringement, then any patent licenses granted to You 100 | under this License for that Work shall terminate as of the date such litigation 101 | is filed. 102 | 103 | 4. Redistribution. You may reproduce and distribute copies of the Work or 104 | Derivative Works thereof in any medium, with or without modifications, and 105 | in Source or Object form, provided that You meet the following conditions: 106 | 107 | (a) You must give any other recipients of the Work or Derivative Works a copy 108 | of this License; and 109 | 110 | (b) You must cause any modified files to carry prominent notices stating that 111 | You changed the files; and 112 | 113 | (c) You must retain, in the Source form of any Derivative Works that You distribute, 114 | all copyright, patent, trademark, and attribution notices from the Source 115 | form of the Work, excluding those notices that do not pertain to any part 116 | of the Derivative Works; and 117 | 118 | (d) If the Work includes a "NOTICE" text file as part of its distribution, 119 | then any Derivative Works that You distribute must include a readable copy 120 | of the attribution notices contained within such NOTICE file, excluding those 121 | notices that do not pertain to any part of the Derivative Works, in at least 122 | one of the following places: within a NOTICE text file distributed as part 123 | of the Derivative Works; within the Source form or documentation, if provided 124 | along with the Derivative Works; or, within a display generated by the Derivative 125 | Works, if and wherever such third-party notices normally appear. The contents 126 | of the NOTICE file are for informational purposes only and do not modify the 127 | License. You may add Your own attribution notices within Derivative Works 128 | that You distribute, alongside or as an addendum to the NOTICE text from the 129 | Work, provided that such additional attribution notices cannot be construed 130 | as modifying the License. 131 | 132 | You may add Your own copyright statement to Your modifications and may provide 133 | additional or different license terms and conditions for use, reproduction, 134 | or distribution of Your modifications, or for any such Derivative Works as 135 | a whole, provided Your use, reproduction, and distribution of the Work otherwise 136 | complies with the conditions stated in this License. 137 | 138 | 5. Submission of Contributions. Unless You explicitly state otherwise, any 139 | Contribution intentionally submitted for inclusion in the Work by You to the 140 | Licensor shall be under the terms and conditions of this License, without 141 | any additional terms or conditions. Notwithstanding the above, nothing herein 142 | shall supersede or modify the terms of any separate license agreement you 143 | may have executed with Licensor regarding such Contributions. 144 | 145 | 6. Trademarks. This License does not grant permission to use the trade names, 146 | trademarks, service marks, or product names of the Licensor, except as required 147 | for reasonable and customary use in describing the origin of the Work and 148 | reproducing the content of the NOTICE file. 149 | 150 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to 151 | in writing, Licensor provides the Work (and each Contributor provides its 152 | Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 153 | KIND, either express or implied, including, without limitation, any warranties 154 | or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR 155 | A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness 156 | of using or redistributing the Work and assume any risks associated with Your 157 | exercise of permissions under this License. 158 | 159 | 8. Limitation of Liability. In no event and under no legal theory, whether 160 | in tort (including negligence), contract, or otherwise, unless required by 161 | applicable law (such as deliberate and grossly negligent acts) or agreed to 162 | in writing, shall any Contributor be liable to You for damages, including 163 | any direct, indirect, special, incidental, or consequential damages of any 164 | character arising as a result of this License or out of the use or inability 165 | to use the Work (including but not limited to damages for loss of goodwill, 166 | work stoppage, computer failure or malfunction, or any and all other commercial 167 | damages or losses), even if such Contributor has been advised of the possibility 168 | of such damages. 169 | 170 | 9. Accepting Warranty or Additional Liability. While redistributing the Work 171 | or Derivative Works thereof, You may choose to offer, and charge a fee for, 172 | acceptance of support, warranty, indemnity, or other liability obligations 173 | and/or rights consistent with this License. However, in accepting such obligations, 174 | You may act only on Your own behalf and on Your sole responsibility, not on 175 | behalf of any other Contributor, and only if You agree to indemnify, defend, 176 | and hold each Contributor harmless for any liability incurred by, or claims 177 | asserted against, such Contributor by reason of your accepting any such warranty 178 | or additional liability. END OF TERMS AND CONDITIONS 179 | 180 | APPENDIX: How to apply the Apache License to your work. 181 | 182 | To apply the Apache License to your work, attach the following boilerplate 183 | notice, with the fields enclosed by brackets "[]" replaced with your own identifying 184 | information. (Don't include the brackets!) The text should be enclosed in 185 | the appropriate comment syntax for the file format. We also recommend that 186 | a file or class name and description of purpose be included on the same "printed 187 | page" as the copyright notice for easier identification within third-party 188 | archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | 194 | you may not use this file except in compliance with the License. 195 | 196 | You may obtain a copy of the License at 197 | 198 | http://www.apache.org/licenses/LICENSE-2.0 199 | 200 | Unless required by applicable law or agreed to in writing, software 201 | 202 | distributed under the License is distributed on an "AS IS" BASIS, 203 | 204 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 205 | 206 | See the License for the specific language governing permissions and 207 | 208 | limitations under the License. 209 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Examples of HTML5 Applications for SAP Business Technology Platform Multi-Cloud Environments 2 | 3 | [![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/multi-cloud-html5-apps-samples/)](https://api.reuse.software/info/github.com/SAP-samples/multi-cloud-html5-apps-samples/) 4 | 5 | This repository contains examples of HTML5 applications for multiple SAP BTP environments. The examples show how you can use standalone application routers or managed application routers to achieve different goals and they demonstrate the capabilities of the SAP HTML5 Application Repository service for SAP BTP. 6 | 7 | On the Cloud Foundry and Kyma environment of SAP BTP, you can run an application that was uploaded to the SAP HTML5 Application Repository service for SAP BTP using one of the following options: a standalone application router or a managed application router. Both options allow you to serve static content from the HTML5 Application Repository, authenticate users, rewrite URLs, and forward or proxy requests to other micro services while propagating user information. However, the option that is managed brings many benefits, such as: 8 | - Simplifying and speeding up your development and deployment experience 9 | - Saving resources by running a serverless HTML5 application, which doesn’t require any application runtime 10 | - Lower maintenance efforts by leveraging the most up-to-date routing capabilities 11 | - Meeting the changing demand for HTML5 applications by automatically adjusting the service to maintain consistent and predictable performance 12 | 13 | In general, we recommend using the managed application router. Use an standalone application router preferably only in advanced cases, for example when application router extensibility is required. 14 | 15 | For more information, see 16 | - [Developing HTML5 Applications with the Managed Application Router](https://help.sap.com/viewer/ad4b9f0b14b0458cad9bd27bf435637d/Cloud/en-US/c1b9d6facfc942e3bca664ae06387e9b.html) 17 | - [Developing HTML5 Applications in the Cloud Foundry Environment](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/11d77aa154f64c2e83cc9652a78bb985.html) 18 | 19 | # Examples for SAP BTP, Cloud Foundry Environment 20 | 21 | Before you start with the examples, please make sure that you are familiar with the basic concepts of HTML5 web apps in the Cloud Foundry environment, such as Cloud Foundry applications, services, service bindings. For more information, see [this video](https://www.youtube.com/watch?v=emnl-y9btdU). 22 | 23 | The HTML5 Application Repository can hold any UI project independent of the used framework. Use the following commands of the [Cloud Foundry CLI plugin](https://sap.github.io/cf-html5-apps-repo-cli-plugin/) plugin to upload the HTML5 apps to the application repository: 24 | 25 | ```bash 26 | mkdir myapp 27 | cd myapp 28 | echo '{"sap.app":{"id":"myapp","applicationVersion":{"version": "1.0.0"}}}' > manifest.json 29 | echo '{"routes":[{"source":"^(.*)","target": "$1","service":"html5-apps-repo-rt"}]}' > xs-app.json 30 | cf html5-push 31 | ``` 32 | 33 | For information about how to upload a react-based application to the HTML5 Application Repository, see [this blog post](https://blogs.sap.com/2019/06/03/cloudfoundryfun-5-play-asteroids-powered-by-react-secured-by-sap-cloud-platform/). 34 | 35 | ## Requirements 36 | - You need one of the following SAP BTP account types: 37 | - SAP BTP **trial account** in the region Europe (Frankfurt), or an SAP BTP **free tier** account. For creating an account see this [tutorial](https://developers.sap.com/group.btp-setup.html). 38 | - SAP BTP productive account 39 | - Node.js LTS version 14 is installed: 40 | - Cloud Foundry Command Line tool (cf CLI) is installed. For more information, see this [tutorial](https://developers.sap.com/tutorials/cp-cf-download-cli.html) 41 | - The Multi-Target Application Cloud Foundry CLI [Plugin](https://github.com/cloudfoundry-incubator/multiapps-cli-plugin) (MultiApps CF CLI Plugin) is installed : 42 | ``` 43 | cf add-plugin-repo CF-Community https://plugins.cloudfoundry.org 44 | cf install-plugin multiapps 45 | ``` 46 | - GNU Make : 47 | 48 | If you are running macOS or Linux it's likely that you already have Make installed. As a Windows user, please use the [Chocolatey](https://chocolatey.org/) package manager to install [Make](https://chocolatey.org/packages/make) via `choco install make`. After the installation, please check you can start the executable (`make`) from the terminal. 49 | 50 | 51 | ## HTML5 Apps Running on a Standalone Application Router 52 | 53 | - [Basic app directly embedded into Cloud Foundry environment](standalone-approuter-html5-local-dir/) 54 | 55 | - [Basic App stored on HTML5 Application Repository](standalone-approuter-html5-runtime) 56 | 57 | - [Basic App stored on HTML5 Application Repository, using XSUAA service, and destination service](standalone-approuter-html5-runtime-mta-hello-world) 58 | 59 | - [Multi-tenant SAP Fiori app on HTML5 Application Repository](standalone-mtx-approuter) 60 | 61 | - [SAP Fiori app integrated with SAP Cloud Portal service](standalone-portal-mta) 62 | 63 | - [SAP Fiori app integrated with SAP Cloud Portal service and using UI5 flexibility service for key users](standalone-portal-keyuser-mta) 64 | 65 | 66 | ## HTML5 Apps Using the Managed Application Router 67 | 68 | In contrast to the examples above, you don't need an application router for the following apps, which use the managed application router. This reduces the total cost of ownership (TCO) and you don't have to update the application router manually. 69 | 70 | - [Basic HTML5 App with a Managed Application Router, XSUAA service, and destination service](managed-html5-runtime-basic-mta) 71 | - [SAP Fiori App with a Managed Application Router, XSUAA service, and destination service](managed-html5-runtime-fiori-mta) 72 | 73 | ### Optional backend service 74 | - [SAP Fiori App example consume a public service, to use instead a CAP service with required authentication look at optional-self-hosted-backend](optional-self-hosted-backend) 75 | 76 | # Examples for SAP BTP, Kubernetes Environment 77 | 78 | ## HTML5 Apps Using the Managed Application Router 79 | - [Basic SAPUI5 App with a Managed Application Router and a Backend Component in the Kyma Runtime](managed-html5-runtime-jwt-kyma) 80 | 81 | ## Known Issues 82 | None so far :) 83 | 84 | ## Support 85 | This content is provided "as-is" with no other support. 86 | -------------------------------------------------------------------------------- /REUSE.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | SPDX-PackageName = "multi-cloud-html5-apps-samples" 3 | SPDX-PackageSupplier = "Marius Obert " 4 | SPDX-PackageDownloadLocation = "https://github.com/SAP-samples/multi-cloud-html5-apps-samples/" 5 | SPDX-PackageComment = "The code in this project may include calls to APIs (“API Calls”) of\n SAP or third-party products or services developed outside of this project\n (“External Products”).\n “APIs” means application programming interfaces, as well as their respective\n specifications and implementing code that allows software to communicate with\n other software.\n API Calls to External Products are not licensed under the open source license\n that governs this project. The use of such API Calls and related External\n Products are subject to applicable additional agreements with the relevant\n provider of the External Products. In no event shall the open source license\n that governs this project grant any rights in or to any External Products,or\n alter, expand or supersede any terms of the applicable additional agreements.\n If you have a valid license agreement with SAP for the use of a particular SAP\n External Product, then you may make use of any API Calls included in this\n project’s code for that SAP External Product, subject to the terms of such\n license agreement. If you do not have a valid license agreement for the use of\n a particular SAP External Product, then you may only make use of any API Calls\n in this project for that SAP External Product for your internal, non-productive\n and non-commercial test and evaluation of such API Calls. Nothing herein grants\n you any rights to use or access any SAP External Product, or provide any third\n parties the right to use of access any SAP External Product, through API Calls." 6 | 7 | [[annotations]] 8 | path = "**" 9 | precedence = "aggregate" 10 | SPDX-FileCopyrightText = "2018-2020 SAP SE or an SAP affiliate company and multi-cloud-html5-apps-samples contributors" 11 | SPDX-License-Identifier = "Apache-2.0" 12 | -------------------------------------------------------------------------------- /managed-html5-runtime-basic-mta/HTML5Module/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | This is title 4 |
5 | 6 | 17 | 18 | 19 | Hello World 20 | 21 | 22 | -------------------------------------------------------------------------------- /managed-html5-runtime-basic-mta/HTML5Module/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "1.12.0", 3 | "sap.app": { 4 | "id": "sample.basic.html5.mta", 5 | "type": "application", 6 | "title": "Basic HTML5 App", 7 | "applicationVersion": { 8 | "version": "0.0.1" 9 | } 10 | }, 11 | "sap.cloud": { 12 | "public": true, 13 | "service": "multi-cloud-html5-apps-samples" 14 | }, 15 | "sap.ui5": { 16 | "dependencies": { 17 | "minUI5Version": "1.65.0" 18 | }, 19 | "contentDensities": { 20 | "compact": true, 21 | "cozy": true 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /managed-html5-runtime-basic-mta/HTML5Module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "HTML5Module", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "build": "npm run clean && npm run zip", 6 | "zip": "npx bestzip HTML5Module-content.zip *", 7 | "clean": "npx rimraf HTML5Module-content.zip dist" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /managed-html5-runtime-basic-mta/HTML5Module/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/index.html", 3 | "authenticationMethod": "route", 4 | "routes": [ 5 | { 6 | "source": "/user-api/currentUser$", 7 | "target": "/currentUser", 8 | "service": "sap-approuter-userapi" 9 | }, 10 | { 11 | "source": "^(.*)$", 12 | "target": "$1", 13 | "service": "html5-apps-repo-rt", 14 | "authenticationType": "xsuaa" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /managed-html5-runtime-basic-mta/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/managed-html5-runtime-basic-mta/diagram.png -------------------------------------------------------------------------------- /managed-html5-runtime-basic-mta/mta.yaml: -------------------------------------------------------------------------------- 1 | _schema-version: "3.2" 2 | ID: "sample-basic-html5-mta" 3 | version: 1.0.0 4 | 5 | build-parameters: 6 | before-all: 7 | - builder: custom 8 | commands: 9 | - npm install 10 | 11 | modules: 12 | - name: sample-basic-html5-destination-content 13 | type: com.sap.application.content 14 | requires: 15 | - name: sample-basic-html5-uaa 16 | - name: sample-basic-html5-repo-host 17 | - name: sample-basic-html5-destination-service 18 | parameters: 19 | content-target: true 20 | parameters: 21 | content: 22 | instance: 23 | destinations: 24 | - Name: sample-basic-html5-repo-host 25 | ServiceInstanceName: sample-basic-html5-repo-host 26 | ServiceKeyName: sample-basic-html5-repo-host-key 27 | sap.cloud.service: multi-cloud-html5-apps-samples 28 | - Name: sample-basic-html5-uaa 29 | ServiceInstanceName: sample-basic-html5-uaa 30 | ServiceKeyName: sample-basic-html5-uaa-key 31 | sap.cloud.service: multi-cloud-html5-apps-samples 32 | Authentication: OAuth2UserTokenExchange 33 | existing_destinations_policy: update 34 | build-parameters: 35 | no-source: true 36 | - name: sample-basic-html5-ui-deployer 37 | type: com.sap.application.content 38 | path: . 39 | requires: 40 | - name: sample-basic-html5-repo-host 41 | parameters: 42 | content-target: true 43 | build-parameters: 44 | build-result: resources 45 | requires: 46 | - artifacts: 47 | - HTML5Module-content.zip 48 | name: HTML5Module 49 | target-path: resources/ 50 | - name: HTML5Module 51 | type: html5 52 | path: HTML5Module 53 | build-parameters: 54 | builder: custom 55 | commands: 56 | - npm run build 57 | supported-platforms: [] 58 | resources: 59 | - name: sample-basic-html5-destination-service 60 | type: org.cloudfoundry.managed-service 61 | parameters: 62 | service: destination 63 | service-name: sample-basic-html5-destination-service 64 | service-plan: lite 65 | config: 66 | HTML5Runtime_enabled: true 67 | version: 1.0.0 68 | - name: sample-basic-html5-repo-host 69 | type: org.cloudfoundry.managed-service 70 | parameters: 71 | service: html5-apps-repo 72 | service-plan: app-host 73 | service-keys: 74 | - name: sample-basic-html5-repo-host-key 75 | - name: sample-basic-html5-uaa 76 | type: org.cloudfoundry.managed-service 77 | parameters: 78 | path: ./xs-security.json 79 | service: xsuaa 80 | service-plan: application 81 | service-keys: 82 | - name: sample-basic-html5-uaa-key 83 | -------------------------------------------------------------------------------- /managed-html5-runtime-basic-mta/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "managed-html5-runtime-basic-mta", 3 | "dependencies": { 4 | "mbt": "latest" 5 | }, 6 | "scripts": { 7 | "build": "mbt build --mtar managed-html5-runtime-basic-mta", 8 | "deploy": "cf deploy mta_archives/managed-html5-runtime-basic-mta.mtar" 9 | }, 10 | "version": "1.0.0" 11 | } 12 | -------------------------------------------------------------------------------- /managed-html5-runtime-basic-mta/readme.md: -------------------------------------------------------------------------------- 1 | # Basic HTML5 App with a Managed Application Router 2 | 3 | ## Diagram 4 | 5 | ![diagram](diagram.png) 6 | 7 | 8 | ## Description 9 | 10 | This is an example of an HTML5 app that is accessed by a managed application router and is integrated into the SAP Build Work Zone, standard edition (formerly SAP Launchpad service). During the build process (`mbt build`), the app is compressed into a zip file. During the deployment (`cf deploy`), the HTML5 app is pushed to the HTML5 Application Repository and uses the Authentication & Authorization service (XSUAA service) and the destination service. 11 | 12 | ## Download and Deployment 13 | 1. Subscribe to the [SAP Launchpad service](https://developers.sap.com/tutorials/cp-portal-cloud-foundry-getting-started.html) if you haven't done so before. 14 | 1. Download the source code: 15 | ``` 16 | git clone https://github.com/SAP-samples/multi-cloud-html5-apps-samples 17 | cd multi-cloud-html5-apps-samples/managed-html5-runtime-basic-mta 18 | ``` 19 | 3. Build the project: 20 | ``` 21 | npm install 22 | npm run build 23 | ``` 24 | 4. Deploy the project: 25 | ``` 26 | cf deploy mta_archives/managed-html5-runtime-basic-mta.mtar 27 | ``` 28 | 5. See the URL of the web app: 29 | ``` 30 | cf html5-list -di sample-basic-html5-destination-service -u --runtime launchpad 31 | ``` 32 | 33 | > Use the following command in case you use the Portal service 34 | > 35 | > `cf html5-list -di sample-basic-html5-destination-service -u --runtime cpp` 36 | 37 | 38 | ## Check the Result 39 | 40 | ### List the Deployed HTML5 Apps 41 | ``` 42 | $ cf html5-list -di sample-basic-html5-destination-service -u --runtime launchpad 43 | Getting list of HTML5 applications in org 9f10ed8atrial / space dev as firstname.lastname@domain.com... 44 | OK 45 | 46 | name version app-host-id service name destination name destination service name last changed url 47 | samplebasichtml5mta 0.0.1 66d2a9fd-9f24-48f0-a05a-f6ffe5a1fcdd multi-cloud-html5-apps-samples sample-basic-html5-repo-host sample-basic-html5-destination-service Wed, 30 Apr 2025 12:37:20 GMT https://e983544etrial.launchpad.cfapps.us10.hana.ondemand.com/ff91dc2c-9a21-4ac2-a2f6-914610750dd3.multi-cloud-html5-apps-samples.samplebasichtml5mta-0.0.1/ 48 | ``` 49 | 50 | 51 | ### List the Deployed MTA 52 | 53 | ``` 54 | $ cf mta sample-basic-html5-mta 55 | Showing health and status for multi-target app sample-basic-html5-mta in org e983544etrial / space dev as nicolai.schoenteich@sap.com... 56 | OK 57 | Version: 1.0.0 58 | Namespace: 59 | 60 | Apps: 61 | name requested state instances memory disk urls 62 | 63 | Services: 64 | name service plan bound apps last operation 65 | sample-basic-html5-repo-host html5-apps-repo app-host create succeeded 66 | sample-basic-html5-uaa xsuaa application create succeeded 67 | sample-basic-html5-destination-service destination lite create succeeded 68 | 69 | ``` 70 | 71 | ### Check the HTML5 App 72 | 73 | Access the URL described in [Download and Deployment](#download-and-deployment) to view the web app. You are redirected to a sign-on page before you can see the web app. 74 | 75 | ![webapp](result.png) 76 | -------------------------------------------------------------------------------- /managed-html5-runtime-basic-mta/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/managed-html5-runtime-basic-mta/result.png -------------------------------------------------------------------------------- /managed-html5-runtime-basic-mta/xs-security.json: -------------------------------------------------------------------------------- 1 | { 2 | "xsappname": "hello-world", 3 | "tenant-mode": "dedicated", 4 | "description": "Security profile of called application", 5 | "scopes": [ 6 | { 7 | "name": "uaa.user", 8 | "description": "UAA" 9 | } 10 | ], 11 | "role-templates": [ 12 | { 13 | "name": "Token_Exchange", 14 | "description": "UAA", 15 | "scope-references": [ 16 | "uaa.user" 17 | ] 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/HTML5Module/Component.js: -------------------------------------------------------------------------------- 1 | sap.ui.define(['sap/suite/ui/generic/template/lib/AppComponent'], function (AppComponent) { 2 | return AppComponent.extend('com.sap.fioriapp.Component', { 3 | metadata: { 4 | manifest: 'json' 5 | } 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/HTML5Module/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Products 9 | 23 | 24 | 25 | 26 | 35 | 36 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/HTML5Module/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "1.12.0", 3 | "sap.cloud": { 4 | "public": true, 5 | "service": "multi-cloud-html5-apps-samples" 6 | }, 7 | "sap.app": { 8 | "id": "sample.manage.products.fiori.launchpad.mta", 9 | "type": "application", 10 | "applicationVersion": { 11 | "version": "0.0.1" 12 | }, 13 | "title": "Fiori App", 14 | "dataSources": { 15 | "mainService": { 16 | "uri": "v2/Northwind/Northwind.svc/", 17 | "type": "OData", 18 | "settings": { 19 | "annotations": [ 20 | "annotation" 21 | ], 22 | "localUri": "localService/metadata.xml" 23 | } 24 | } 25 | }, 26 | "offline": false, 27 | "sourceTemplate": { 28 | "id": "ui5template.smartTemplate", 29 | "version": "1.40.12" 30 | }, 31 | "crossNavigation": { 32 | "inbounds": { 33 | "fe-inbound": { 34 | "signature": { 35 | "parameters": {}, 36 | "additionalParameters": "allowed" 37 | }, 38 | "semanticObject": "masterDetail", 39 | "action": "display", 40 | "title": "Available Products", 41 | "subTitle": "", 42 | "icon": "" 43 | } 44 | } 45 | } 46 | }, 47 | "sap.ui": { 48 | "technology": "UI5", 49 | "icons": { 50 | "icon": "", 51 | "favIcon": "", 52 | "phone": "", 53 | "phone@2": "", 54 | "tablet": "", 55 | "tablet@2": "" 56 | }, 57 | "deviceTypes": { 58 | "desktop": true, 59 | "tablet": true, 60 | "phone": true 61 | }, 62 | "supportedThemes": [ 63 | "sap_hcb", 64 | "sap_belize" 65 | ] 66 | }, 67 | "sap.ui5": { 68 | "resources": { 69 | "js": [], 70 | "css": [] 71 | }, 72 | "dependencies": { 73 | "minUI5Version": "1.65.0", 74 | "libs": {}, 75 | "components": {} 76 | }, 77 | "models": { 78 | "": { 79 | "dataSource": "mainService", 80 | "preload": true, 81 | "settings": { 82 | "defaultBindingMode": "TwoWay", 83 | "defaultCountMode": "Inline", 84 | "refreshAfterChange": false, 85 | "metadataUrlParams": { 86 | "sap-value-list": "none" 87 | } 88 | } 89 | } 90 | }, 91 | "contentDensities": { 92 | "compact": true, 93 | "cozy": true 94 | } 95 | }, 96 | "sap.ui.generic.app": { 97 | "_version": "1.3.0", 98 | "settings": { 99 | "forceGlobalRefresh": false, 100 | "objectPageHeaderType": "Dynamic", 101 | "showDraftToggle": false 102 | }, 103 | "pages": { 104 | "ListReport|Products": { 105 | "entitySet": "Products", 106 | "component": { 107 | "name": "sap.suite.ui.generic.template.ListReport", 108 | "list": true, 109 | "settings": { 110 | "condensedTableLayout": true, 111 | "smartVariantManagement": true, 112 | "enableTableFilterInPageVariant": true 113 | } 114 | }, 115 | "pages": { 116 | "ObjectPage|Products": { 117 | "entitySet": "Products", 118 | "component": { 119 | "name": "sap.suite.ui.generic.template.ObjectPage" 120 | } 121 | } 122 | } 123 | } 124 | } 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/HTML5Module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "HTML5Module", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "build": "npm run clean && npm run zip", 6 | "zip": "npx bestzip manifest-bundle.zip manifest.json && npx bestzip HTML5Module-content.zip *", 7 | "clean": "npx rimraf HTML5Module1-content.zip manifest-bundle.zip" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/HTML5Module/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/index.html", 3 | "authenticationMethod": "route", 4 | "routes": [ 5 | { 6 | "source": "^/user-api(.*)", 7 | "target": "$1", 8 | "service": "sap-approuter-userapi" 9 | }, 10 | { 11 | "authenticationType": "none", 12 | "csrfProtection": false, 13 | "source": "^/v2/(.*)$", 14 | "destination": "Northwind" 15 | }, 16 | { 17 | "source": "^(.*)$", 18 | "target": "$1", 19 | "service": "html5-apps-repo-rt", 20 | "authenticationType": "xsuaa" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/HTML5Module1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/managed-html5-runtime-fiori-launchpad-mta/HTML5Module1.png -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/contentExplorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/managed-html5-runtime-fiori-launchpad-mta/contentExplorer.png -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/destination.json: -------------------------------------------------------------------------------- 1 | { 2 | "HTML5Runtime_enabled": true, 3 | "version": "1.0.0", 4 | "init_data": { 5 | "instance": { 6 | "existing_destinations_policy": "update", 7 | "destinations": [ 8 | { 9 | "Name": "Northwind", 10 | "Description": "Automatically generated Northwind destination", 11 | "Authentication": "NoAuthentication", 12 | "ProxyType": "Internet", 13 | "Type": "HTTP", 14 | "URL": "https://services.odata.org", 15 | "HTML5.DynamicDestination": true 16 | } 17 | ] 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/managed-html5-runtime-fiori-launchpad-mta/diagram.png -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/mta.yaml: -------------------------------------------------------------------------------- 1 | ID: "sample-manage-products-fiori-launchpad-mta" 2 | _schema-version: 3.2.0 3 | version: 1.0.0 4 | parameters: 5 | enable-parallel-deployments: true 6 | modules: 7 | - name: HTML5Module 8 | type: html5 9 | path: HTML5Module 10 | build-parameters: 11 | builder: custom 12 | commands: 13 | - npm run build 14 | supported-platforms: [] 15 | - name: sample-manage-products-deployer 16 | type: com.sap.application.content 17 | path: . 18 | requires: 19 | - name: sample-manage-products-html5-repo-host 20 | parameters: 21 | content-target: true 22 | build-parameters: 23 | build-result: resources 24 | requires: 25 | - artifacts: 26 | - HTML5Module-content.zip 27 | name: HTML5Module 28 | target-path: resources/ 29 | - name: sample-manage-products-destination-content 30 | type: com.sap.application.content 31 | build-parameters: 32 | no-source: true 33 | requires: 34 | - name: sample-manage-products-auth 35 | parameters: 36 | service-key: 37 | name: sample-manage-products-auth-key 38 | - name: sample-manage-products-html5-repo-host 39 | parameters: 40 | service-key: 41 | name: sample-manage-products-html5-repo-host-key 42 | - name: sample-manage-products-destination 43 | parameters: 44 | content-target: true 45 | parameters: 46 | content: 47 | instance: 48 | existing_destinations_policy: update 49 | destinations: 50 | - Name: sample-manage-products-destination-html5 51 | ServiceInstanceName: sample-manage-products-html5-repo-host 52 | ServiceKeyName: sample-manage-products-html5-repo-host-key 53 | sap.cloud.service: multi-cloud-html5-apps-samples 54 | - Name: sample-manage-products-destination-auth 55 | Authentication: OAuth2UserTokenExchange 56 | ServiceInstanceName: sample-manage-products-auth 57 | ServiceKeyName: sample-manage-products-auth-key 58 | sap.cloud.service: multi-cloud-html5-apps-samples 59 | 60 | resources: 61 | - name: sample-manage-products-destination 62 | type: org.cloudfoundry.managed-service 63 | parameters: 64 | service-plan: lite 65 | service: destination 66 | path: ./destination.json 67 | - name: sample-manage-products-html5-repo-host 68 | type: org.cloudfoundry.managed-service 69 | parameters: 70 | service-plan: app-host 71 | service: html5-apps-repo 72 | config: 73 | sizeLimit: 2 74 | - name: sample-manage-products-auth 75 | type: org.cloudfoundry.managed-service 76 | parameters: 77 | service: xsuaa 78 | service-plan: application 79 | path: ./xs-security.json 80 | config: 81 | xsappname: sample-manage-products-${org}-${space} 82 | tenant-mode: dedicated 83 | -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "managed-html5-runtime-fiori-launchpad-mta", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "build": "mbt build --mtar managed-html5-runtime-fiori-launchpad-mta", 6 | "deploy": "cf deploy mta_archives/managed-html5-runtime-fiori-launchpad-mta.mtar" 7 | }, 8 | "devDependencies": { 9 | "mbt": "latest" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/readme.md: -------------------------------------------------------------------------------- 1 | # SAP Fiori App with a Managed Application Router Exposed to SAP Launchpad Service 2 | 3 | ## Diagram 4 | 5 | ![diagram](diagram.png) 6 | 7 | 8 | ## Description 9 | 10 | This is an example of an SAP Fiori app ([HTML5Module](./HTML5Module/) that is configured to run with the managed application router. The app is exposed to SAP Build Work Zone, standard edition and is visible in the content manager of the launchpad. The app is deployed to the HTML5 Application Repository via the Cloud Foundry environment and uses the Authentication & Authorization (XSUAA) and the destination service. It consumes the public [Northwind OData service](https://services.odata.org/v2/Northwind/Northwind.svc) - to use instead a CAP service with required authentication have look at [optional-self-hosted-backend](../optional-self-hosted-backend/). 11 | 12 | ## Download and Deployment 13 | 1. Subscribe to the [SAP Build Work Zone, standard edition](https://developers.sap.com/tutorials/cp-portal-cloud-foundry-getting-started.html) if you haven't done so before. 14 | 2. Download the source code: 15 | ``` 16 | git clone https://github.com/SAP-samples/multi-cloud-html5-apps-samples 17 | cd multi-cloud-html5-apps-samples/managed-html5-runtime-fiori-launchpad-mta 18 | ``` 19 | 3. Build the project: 20 | ``` 21 | npm install 22 | npm run build 23 | ``` 24 | 4. Deploy the project: 25 | ``` 26 | npm run deploy 27 | ``` 28 | or 29 | ``` 30 | cf deploy mta_archives/managed-html5-runtime-fiori-launchpad-mta.mtar 31 | ``` 32 | 5. List the deployed HTML5 apps: 33 | ``` 34 | cf html5-list -di sample-manage-products-destination -u --runtime launchpad 35 | ``` 36 | 37 | > Use the following command in case you use the Portal service 38 | > 39 | > `cf html5-list -di sample-manage-products-destination -u --runtime cpp` 40 | 41 | 42 | ## Check the Result 43 | 44 | ### List the Deployed HTML5 Apps 45 | ``` 46 | $ cf html5-list -di sample-manage-products-destination -u --runtime launchpad 47 | Getting list of HTML5 applications available via destinations in org e983544etrial / space dev as nicolai.schoenteich@sap.com... 48 | OK 49 | 50 | name version app-host-id service name destination name destination service name last changed url 51 | samplemanageproductsfiorilaunchpadmta 0.0.1 e436f722-995c-4e5e-86ce-fab1b1138738 multi-cloud-html5-apps-samples sample-manage-products-destination-html5 sample-manage-products-destination Wed, 30 Apr 2025 12:57:18 GMT https://e983544etrial.launchpad.cfapps.us10.hana.ondemand.com/41648f37-046e-40cb-9537-88d604988f21.multi-cloud-html5-apps-samples.samplemanageproductsfiorilaunchpadmta-0.0.1/ 52 | ``` 53 | 54 | ### List the Deployed MTA 55 | 56 | ``` 57 | $ cf mta sample-manage-products-fiori-launchpad-mta 58 | Showing health and status for multi-target app sample-manage-products-fiori-launchpad-mta in org e983544etrial / space dev as nicolai.schoenteich@sap.com... 59 | OK 60 | Version: 1.0.0 61 | Namespace: 62 | 63 | Apps: 64 | name requested state instances memory disk urls 65 | 66 | Services: 67 | name service plan bound apps last operation 68 | sample-manage-products-html5-repo-host html5-apps-repo app-host create succeeded 69 | sample-manage-products-destination destination lite create succeeded 70 | sample-manage-products-auth xsuaa application create succeeded 71 | ``` 72 | 73 | 74 | ### List the Deployed Content with the Content Explorer 75 | 76 | ![Content Explorer](contentExplorer.png) 77 | 78 | 79 | ### Check the HTML5 Apps 80 | 81 | Access one of the URLs described in the [Download and Deployment](#download-and-deployment) section. You are redirected to a sign-on page before you can see the app. 82 | 83 | ![HTML5Module1](HTML5Module1.png) 84 | -------------------------------------------------------------------------------- /managed-html5-runtime-fiori-launchpad-mta/xs-security.json: -------------------------------------------------------------------------------- 1 | { 2 | "scopes": [ 3 | { 4 | "name": "$XSAPPNAME.admin", 5 | "description": "admin" 6 | } 7 | ], 8 | "attributes": [], 9 | "role-templates": [ 10 | { 11 | "name": "admin", 12 | "description": "generated", 13 | "scope-references": [ 14 | "$XSAPPNAME.admin" 15 | ], 16 | "attribute-references": [] 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/README.md: -------------------------------------------------------------------------------- 1 | # Basic SAPUI5 App with a Managed Application Router and a Backend Component in the Kyma Runtime 2 | 3 | 4 | ## Diagram 5 | 6 | ![diagram](diagram.png) 7 | 8 | 9 | ## Description 10 | 11 | This is an example of an SAP Fiori app that is accessed by a managed application router and a backend component that runs in the Kyma runtime. The SAPUI5 app is exposed to an SAP Launchpad service and is visible in the content manager of the launchpad. The app is deployed to the HTML5 Application Repository via the Kyma runtime and uses the Authentication & Authorization service (XSUAA service) and the destination service. 12 | The backend component accepts incoming requests and returns the payload of the decoded JWT token (if available) at `/be`. 13 | 14 | 15 | 16 | As a result of deploying this `/deployment.yaml` you will get 2 pods: 17 | 18 | 1. `html5appdeployer` - an html5-app-deployer library based application that uploads favorites html5 application to HTML5 Application Repository and generates the required destinations. 19 | 2. `backend` - a simple nodejs server that returns the JWT forwarded by the managed application router 20 | 21 | In addition the following service instances are created: 22 | - xsuaa/application service instance bound to backend container 23 | - html5-apps-repo/app-host service instance bound to html5appdeployer container (used to upload content to html5 repo) 24 | - destination/lite instance - this is for future use - (automatically generate destination configurations on instance level) 25 | 26 | ## Download and Deployment 27 | 1. Have an account for a Docker registry and log in the the docker CLI (e.g. [DockerHub](https://docs.docker.com/docker-hub/)) 28 | 1. [Install the Kubernetes Command Line Tool](https://developers.sap.com/tutorials/cp-kyma-download-cli.html) 29 | 1. Subscribe to the [launchpad service](https://developers.sap.com/tutorials/cp-portal-cloud-foundry-getting-started.html) if you haven't done so before. 30 | 2. Build and upload the docker image of the backend component 31 | ``` 32 | cd managed-html5-runtime-jwt-kyma/backend 33 | docker build -t /kyma-simple-backend . 34 | docker push /kyma-simple-backend 35 | ``` 36 | 1. Build and upload the docker image of the html5 app deployer 37 | ``` 38 | cd ../deployer 39 | docker build -t iobert/kyma-html5-app-deployer . 40 | docker push iobert/kyma-html5-app-deployer 41 | ``` 42 | 1. Add your (e.g. "c-13093b0") to the destination which is defined in the environment variable `BACKEND_DESTINATIONS` of the [deployment descriptor](./deployment.yaml). You can find the in the entry page of the Kyma dashboard 43 | 1. Deploy the project 44 | ``` 45 | cd .. 46 | kubectl apply -f deployment.yaml 47 | ``` 48 | 49 | 1. Access the web app via the SAP BTP cockpit or assemble the URL according to the following pattern: 50 | ``` 51 | https://.launchpad.cfapps.eu10.hana.ondemand.com/.businessservice.tokendisplay/index.html -> 52 | https://43de072btrial.launchpad.cfapps.eu10.hana.ondemand.com/8aebc2e1-2234-4bd1-8da4-e15231138dbf.businessservice.tokendisplay/index.html 53 | ``` 54 | 55 | > You can find the destination service instance ID in the Kyma dashboard 56 | ![](instanceId.png) 57 | 58 | 59 | ## Check the Result 60 | 61 | ### Check the HTML5 App 62 | 63 | Access the URL described in [Download and Deployment](#download-and-deployment) to view the web app. You are redirected to a sign-on page before you can see the web app. 64 | 65 | ![webapp](result.png) 66 | -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/backend/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:14-alpine 2 | 3 | RUN mkdir -p /app && \ 4 | chown node.node /app 5 | 6 | # Create app directory 7 | WORKDIR /app 8 | 9 | # Bundle app source 10 | COPY . . 11 | RUN npm install --production 12 | 13 | EXPOSE 5000 14 | CMD [ "npm", "start" ] -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/backend/backend.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | const express = require("express"); 4 | const jwtDecode = require("jwt-decode"); 5 | 6 | var app = express(); 7 | 8 | app.get("/", function (_, res) { 9 | res.end("This app runs on SAP BTP, Kyma Runtime. \n Yay! 🚀"); 10 | }); 11 | 12 | app.get("/token", function (req, res) { 13 | console.log("====Req headers ", req.headers); 14 | let token = req.headers["authorization"]; 15 | if (!token) { 16 | res.end("No token found"); 17 | return; 18 | } 19 | let decodedToken = jwtDecode(token); 20 | res.setHeader("Content-Type", "application/json"); 21 | res.end(JSON.stringify(decodedToken)); 22 | }); 23 | 24 | app.listen(process.env.PORT || 5000); 25 | 26 | -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backend", 3 | "version": "1.0.0", 4 | "main": "backend.js", 5 | "scripts": { 6 | "start": "node backend.js" 7 | }, 8 | "dependencies": { 9 | "express": "^4.17.1", 10 | "jwt-decode": "3.1.2" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/deployer/.dockerignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/deployer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:14-alpine 2 | 3 | RUN mkdir -p /app && \ 4 | chown node.node /app 5 | 6 | # Create app directory 7 | WORKDIR /app 8 | 9 | # Bundle app source 10 | COPY . . 11 | RUN npm install --production 12 | 13 | EXPOSE 5000 14 | CMD [ "npm", "start" ] -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/deployer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kyma-html5-app-deployer", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "@sap/html5-app-deployer": "3.2.0" 6 | }, 7 | "scripts": { 8 | "start": "node node_modules/@sap/html5-app-deployer/index.js" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/deployer/resources/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Kyma Demo App 8 | 11 | 12 | 17 | 57 | 58 | 59 | 60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/deployer/resources/webapp/logout-page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Logout 4 | 5 | 6 |

Logout

7 |

You are now logged out!

8 |

You may return to the application

9 | 10 | -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/deployer/resources/webapp/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "1.12.0", 3 | "sap.app": { 4 | "id": "token.display", 5 | "type": "application", 6 | "i18n": "i18n/i18n.properties", 7 | "applicationVersion": { 8 | "version": "1.0.0" 9 | }, 10 | "title": "Kyma Backend" 11 | }, 12 | "sap.cloud": { 13 | "public": true, 14 | "service": "business.service" 15 | }, 16 | "sap.ui": { 17 | "technology": "UI5", 18 | "icons": { 19 | "icon": "", 20 | "favIcon": "", 21 | "phone": "", 22 | "phone@2": "", 23 | "tablet": "", 24 | "tablet@2": "" 25 | }, 26 | "deviceTypes": { 27 | "desktop": true, 28 | "tablet": true, 29 | "phone": true 30 | } 31 | }, 32 | "sap.ui5": { 33 | "flexEnabled": false, 34 | "rootView": { 35 | "viewName": "ui1.ui1.view.View1", 36 | "type": "XML", 37 | "async": true, 38 | "id": "View1" 39 | }, 40 | "dependencies": { 41 | "minUI5Version": "1.65.6", 42 | "libs": { 43 | "sap.ui.core": {}, 44 | "sap.m": {}, 45 | "sap.ui.layout": {} 46 | } 47 | }, 48 | "contentDensities": { 49 | "compact": true, 50 | "cozy": true 51 | }, 52 | "models": {}, 53 | "resources": {}, 54 | "routing": { 55 | "config": { 56 | "routerClass": "sap.m.routing.Router", 57 | "viewType": "XML", 58 | "async": true, 59 | "viewPath": "ui1.ui1.view", 60 | "controlAggregation": "pages", 61 | "controlId": "app", 62 | "clearControlAggregation": false 63 | }, 64 | "routes": [ 65 | { 66 | "name": "RouteView1", 67 | "pattern": "RouteView1", 68 | "target": [ 69 | "TargetView1" 70 | ] 71 | } 72 | ], 73 | "targets": { 74 | "TargetView1": { 75 | "viewType": "XML", 76 | "transition": "slide", 77 | "clearControlAggregation": false, 78 | "viewId": "View1", 79 | "viewName": "View1" 80 | } 81 | } 82 | } 83 | } 84 | } -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/deployer/resources/webapp/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "index.html", 3 | "authenticationMethod": "route", 4 | "logout": { 5 | "logoutEndpoint": "/my/logout", 6 | "logoutPage": "/logout-page.html" 7 | }, 8 | "routes": [ 9 | { 10 | "source": "^/token$", 11 | "destination": "token-service", 12 | "authenticationType": "xsuaa" 13 | }, 14 | { 15 | "source": "^/logout-page.html$", 16 | "service": "html5-apps-repo-rt", 17 | "authenticationType": "none" 18 | }, 19 | { 20 | "source": "^(/.*)", 21 | "target": "$1", 22 | "service": "html5-apps-repo-rt", 23 | "authenticationType": "xsuaa" 24 | } 25 | ] 26 | } -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/deployment.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: backend 6 | labels: 7 | app: backend 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: backend 13 | template: 14 | metadata: 15 | labels: 16 | app: backend 17 | spec: 18 | containers: 19 | - image: ghcr.io/sap-samples/kyma-simple-backend:latest 20 | imagePullPolicy: Always 21 | name: backend 22 | volumeMounts: 23 | - name: xsuaa-volume 24 | mountPath: /etc/secrets/sapcp/xsuaa/kyma-xsuaa-instance 25 | readOnly: true 26 | volumes: 27 | - name: xsuaa-volume 28 | secret: 29 | secretName: kyma-xsuaa-binding 30 | --- 31 | apiVersion: v1 32 | kind: Service 33 | metadata: 34 | labels: 35 | app: backend 36 | name: backend-svc 37 | spec: 38 | type: NodePort 39 | ports: 40 | - port: 5000 41 | selector: 42 | app: backend 43 | 44 | --- 45 | apiVersion: gateway.kyma-project.io/v1beta1 46 | kind: APIRule 47 | metadata: 48 | labels: 49 | app: backend 50 | name: backend 51 | spec: 52 | gateway: kyma-system/kyma-gateway 53 | host: backend 54 | service: 55 | name: backend-svc 56 | port: 5000 57 | rules: 58 | - path: /.* 59 | methods: ["GET", "POST"] 60 | accessStrategies: 61 | - handler: noop 62 | 63 | --- 64 | apiVersion: apps/v1 65 | kind: Deployment 66 | metadata: 67 | name: html5appdeployer 68 | labels: 69 | app: html5appdeployer 70 | spec: 71 | replicas: 1 72 | selector: 73 | matchLabels: 74 | app: html5appdeployer 75 | template: 76 | metadata: 77 | labels: 78 | app: html5appdeployer 79 | spec: 80 | containers: 81 | - image: ghcr.io/sap-samples/kyma-html5-app-deployer:latest 82 | imagePullPolicy: Always 83 | name: html5appdeployer 84 | volumeMounts: 85 | - name: html5-repo-app-host-volume 86 | mountPath: /etc/secrets/sapcp/html5-apps-repo/kyma-app-host-instance 87 | readOnly: true 88 | - name: xsuaa-volume 89 | mountPath: /etc/secrets/sapcp/xsuaa/kyma-xsuaa-instance 90 | readOnly: true 91 | - name: destination-volume 92 | mountPath: /etc/secrets/sapcp/destination/kyma-destination-instance 93 | readOnly: true 94 | env: 95 | - name: SAP_CLOUD_SERVICE 96 | value: "business.service" 97 | - name: BACKEND_DESTINATIONS 98 | value: "[{ 99 | \"Name\":\"token-service\", 100 | \"Description\":\"my kyma backend\", 101 | \"Type\":\"HTTP\", 102 | \"ProxyType\":\"Internet\", 103 | \"URL\":\"https://backend..stage.kyma.ondemand.com\", 104 | \"Authentication\":\"NoAuthentication\", 105 | \"HTML5.forwardAuthToken\": true}]" 106 | volumes: 107 | - name: html5-repo-app-host-volume 108 | secret: 109 | secretName: kyma-app-host-binding 110 | - name: xsuaa-volume 111 | secret: 112 | secretName: kyma-xsuaa-binding 113 | - name: destination-volume 114 | secret: 115 | secretName: kyma-destination-binding 116 | 117 | --- 118 | apiVersion: services.cloud.sap.com/v1 119 | kind: ServiceInstance 120 | metadata: 121 | name: kyma-xsuaa-instance 122 | spec: 123 | serviceOfferingName: xsuaa 124 | servicePlanName: application 125 | parameters: 126 | xsappname: kyma-app 127 | tenant-mode: shared 128 | scopes: 129 | - name: "$XSAPPNAME.Callback" 130 | description: "With this scope set, the callbacks for tenant onboarding, offboarding and getDependencies can be called." 131 | grant-as-authority-to-apps : 132 | - $XSAPPNAME(application,sap-provisioning,tenant-onboarding) 133 | role-templates: 134 | - name: TOKEN_EXCHANGE 135 | description: Token exchange 136 | scope-references: 137 | - uaa.user 138 | - name: "MultitenancyCallbackRoleTemplate" 139 | description: "Call callback-services of applications" 140 | scope-references: 141 | - "$XSAPPNAME.Callback" 142 | oauth2-configuration: 143 | grant-types: 144 | - authorization_code 145 | - client_credentials 146 | - password 147 | - refresh_token 148 | - urn:ietf:params:oauth:grant-type:saml2-bearer 149 | - user_token 150 | - client_x509 151 | - urn:ietf:params:oauth:grant-type:jwt-bearer 152 | redirect-uris: 153 | - https://*/** 154 | 155 | --- 156 | apiVersion: services.cloud.sap.com/v1 157 | kind: ServiceBinding 158 | metadata: 159 | name: kyma-xsuaa-binding 160 | spec: 161 | serviceInstanceName: kyma-xsuaa-instance 162 | 163 | --- 164 | apiVersion: services.cloud.sap.com/v1 165 | kind: ServiceInstance 166 | metadata: 167 | name: kyma-app-host-instance 168 | spec: 169 | serviceOfferingName: html5-apps-repo 170 | servicePlanName: app-host 171 | 172 | --- 173 | apiVersion: services.cloud.sap.com/v1 174 | kind: ServiceBinding 175 | metadata: 176 | name: kyma-app-host-binding 177 | spec: 178 | serviceInstanceName: kyma-app-host-instance 179 | 180 | --- 181 | apiVersion: services.cloud.sap.com/v1 182 | kind: ServiceInstance 183 | metadata: 184 | name: kyma-destination-instance 185 | spec: 186 | serviceOfferingName: destination 187 | servicePlanName: lite 188 | parameters: 189 | HTML5Runtime_enabled: true 190 | version: "1.0.0" 191 | 192 | --- 193 | apiVersion: services.cloud.sap.com/v1 194 | kind: ServiceBinding 195 | metadata: 196 | name: kyma-destination-binding 197 | spec: 198 | serviceInstanceName: kyma-destination-instance -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/managed-html5-runtime-jwt-kyma/diagram.png -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/instanceId.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/managed-html5-runtime-jwt-kyma/instanceId.png -------------------------------------------------------------------------------- /managed-html5-runtime-jwt-kyma/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/managed-html5-runtime-jwt-kyma/result.png -------------------------------------------------------------------------------- /optional-self-hosted-backend/.cdsrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /optional-self-hosted-backend/.gitignore: -------------------------------------------------------------------------------- 1 | # CAP cap-service 2 | _out 3 | *.db 4 | connection.properties 5 | default-*.json 6 | gen/ 7 | node_modules/ 8 | target/ 9 | 10 | # Web IDE, App Studio 11 | .che/ 12 | .gen/ 13 | 14 | # MTA 15 | *_mta_build_tmp 16 | *.mtar 17 | mta_archives/ 18 | 19 | # Other 20 | .DS_Store 21 | *.orig 22 | *.log 23 | 24 | *.iml 25 | *.flattened-pom.xml 26 | 27 | # IDEs 28 | .vscode 29 | .idea 30 | -------------------------------------------------------------------------------- /optional-self-hosted-backend/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | This is an example of how to consume a CAP service with authentication from on SAP Fiori app. 4 | 5 | The [managed-html5-runtime-fiori-launchpad-mta](../managed-html5-runtime-fiori-launchpad-mta) sample consumes the [Northwind odata.org service](../managed-html5-runtime-fiori-mta/destination.json#L14), this is a public service without any kind of authentication. 6 | 7 | This project [mocks](./srv/cat-service.cds#L3) the Northwind service, the service is exposed as a CAP service with required [authentication](./srv/cat-service.cds#L4). 8 | Deploy of this package [override](./mta.yaml#L88) the URL of the original [Northwind](../managed-html5-runtime-fiori-mta/destination.json#L9) destination with the URL of the mockup service and set the property [HTML5.ForwardAuthToken](./mta.yaml#L90) necessary to forward the authentication user from the SAP Fiori app to the CAP service. 9 | This property is documented at [Configure Destinations](https://help.sap.com/viewer/ad4b9f0b14b0458cad9bd27bf435637d/LATEST/en-US/fab4035652cb4fc48503c65dc841d335.html) 10 | 11 | The MTA file [bind](./mta.yaml#L35) the CAP service to the xsuaa service already created by the [managed-html5-runtime-fiori-mta](../managed-html5-runtime-fiori-mta/mta.yaml#L74) package. 12 | 13 | ## Deployment 14 | 15 | 1. Deploy the `managed-html5-runtime-fiori-mta` to you BTP subaccount as explained in the package documentation 16 | 2. Add the entitlement `hana hdi-shared` to your subaccount if you haven't done so before 17 | 3. Build the project: 18 | ``` 19 | mbt build 20 | ``` 21 | 4. Deploy in the same subaccount/space of the `managed-html5-runtime-fiori-mta` package: 22 | ``` 23 | cf deploy mta_archives/cap-service_1.0.0.mtar 24 | ``` 25 | ## Check the Result 26 | 27 | ### Check the HTML5 App 28 | To be sure to use the new mock service open an incognito browser window and then access the URL of the HTML5 App of the `managed-html5-runtime-fiori-mta` package, you should see the same data, however the product name of the first product will be *Hello from CAP*, this is the mark that the data are read from the CAP service. 29 | 30 | ![image](https://user-images.githubusercontent.com/51169423/132773806-f1964c2f-4679-4f7c-988a-a55824729f55.png) 31 | 32 | -------------------------------------------------------------------------------- /optional-self-hosted-backend/db/data/my.northwind-Products.csv: -------------------------------------------------------------------------------- 1 | ProductID;CategoryID;Discontinued;ProductName;QuantityPerUnit;ReorderLevel;SupplierID;UnitPrice;UnitsInStock;UnitsOnOrder 2 | 1;1;False;Hello from CAP;10 boxes x 20 bags;10;1;18.0000;39;0 3 | 2;1;False;Chang;24 - 12 oz bottles;25;1;19.0000;17;40 4 | 3;2;False;Aniseed Syrup;12 - 550 ml bottles;25;1;10.0000;13;70 5 | 4;2;False;Chef Anton's Cajun Seasoning;48 - 6 oz jars;0;2;22.0000;53;0 6 | 5;2;True;Chef Anton's Gumbo Mix;36 boxes;0;2;21.3500;0;0 7 | 6;2;False;Grandma's Boysenberry Spread;12 - 8 oz jars;25;3;25.0000;120;0 8 | 7;7;False;Uncle Bob's Organic Dried Pears;12 - 1 lb pkgs.;10;3;30.0000;15;0 9 | 8;2;False;Northwoods Cranberry Sauce;12 - 12 oz jars;0;3;40.0000;6;0 10 | 9;6;True;Mishi Kobe Niku;18 - 500 g pkgs.;0;4;97.0000;29;0 11 | 10;8;False;Ikura;12 - 200 ml jars;0;4;31.0000;31;0 12 | 11;4;False;Queso Cabrales;1 kg pkg.;30;5;21.0000;22;30 13 | 12;4;False;Queso Manchego La Pastora;10 - 500 g pkgs.;0;5;38.0000;86;0 14 | 13;8;False;Konbu;2 kg box;5;6;6.0000;24;0 15 | 14;7;False;Tofu;40 - 100 g pkgs.;0;6;23.2500;35;0 16 | 15;2;False;Genen Shouyu;24 - 250 ml bottles;5;6;15.5000;39;0 17 | 16;3;False;Pavlova;32 - 500 g boxes;10;7;17.4500;29;0 18 | 17;6;True;Alice Mutton;20 - 1 kg tins;0;7;39.0000;0;0 19 | 18;8;False;Carnarvon Tigers;16 kg pkg.;0;7;62.5000;42;0 20 | 19;3;False;Teatime Chocolate Biscuits;10 boxes x 12 pieces;5;8;9.2000;25;0 21 | 20;3;False;Sir Rodney's Marmalade;30 gift boxes;0;8;81.0000;40;0 22 | 21;3;False;Sir Rodney's Scones;24 pkgs. x 4 pieces;5;8;10.0000;3;40 23 | 22;5;False;Gustaf's Knäckebröd;24 - 500 g pkgs.;25;9;21.0000;104;0 24 | 23;5;False;Tunnbröd;12 - 250 g pkgs.;25;9;9.0000;61;0 25 | 24;1;True;Guaraná Fantástica;12 - 355 ml cans;0;10;4.5000;20;0 26 | 25;3;False;NuNuCa Nuß-Nougat-Creme;20 - 450 g glasses;30;11;14.0000;76;0 27 | 26;3;False;Gumbär Gummibärchen;100 - 250 g bags;0;11;31.2300;15;0 28 | 27;3;False;Schoggi Schokolade;100 - 100 g pieces;30;11;43.9000;49;0 29 | 28;7;True;Rössle Sauerkraut;25 - 825 g cans;0;12;45.6000;26;0 30 | 29;6;True;Thüringer Rostbratwurst;50 bags x 30 sausgs.;0;12;123.7900;0;0 31 | 30;8;False;Nord-Ost Matjeshering;10 - 200 g glasses;15;13;25.8900;10;0 32 | 31;4;False;Gorgonzola Telino;12 - 100 g pkgs;20;14;12.5000;0;70 33 | 32;4;False;Mascarpone Fabioli;24 - 200 g pkgs.;25;14;32.0000;9;40 34 | 33;4;False;Geitost;500 g;20;15;2.5000;112;0 35 | 34;1;False;Sasquatch Ale;24 - 12 oz bottles;15;16;14.0000;111;0 36 | 35;1;False;Steeleye Stout;24 - 12 oz bottles;15;16;18.0000;20;0 37 | 36;8;False;Inlagd Sill;24 - 250 g jars;20;17;19.0000;112;0 38 | 37;8;False;Gravad lax;12 - 500 g pkgs.;25;17;26.0000;11;50 39 | 38;1;False;Côte de Blaye;12 - 75 cl bottles;15;18;263.5000;17;0 40 | 39;1;False;Chartreuse verte;750 cc per bottle;5;18;18.0000;69;0 41 | 40;8;False;Boston Crab Meat;24 - 4 oz tins;30;19;18.4000;123;0 42 | 41;8;False;Jack's New England Clam Chowder;12 - 12 oz cans;10;19;9.6500;85;0 43 | 42;5;True;Singaporean Hokkien Fried Mee;32 - 1 kg pkgs.;0;20;14.0000;26;0 44 | 43;1;False;Ipoh Coffee;16 - 500 g tins;25;20;46.0000;17;10 45 | 44;2;False;Gula Malacca;20 - 2 kg bags;15;20;19.4500;27;0 46 | 45;8;False;Rogede sild;1k pkg.;15;21;9.5000;5;70 47 | 46;8;False;Spegesild;4 - 450 g glasses;0;21;12.0000;95;0 48 | 47;3;False;Zaanse koeken;10 - 4 oz boxes;0;22;9.5000;36;0 49 | 48;3;False;Chocolade;10 pkgs.;25;22;12.7500;15;70 50 | 49;3;False;Maxilaku;24 - 50 g pkgs.;15;23;20.0000;10;60 51 | 50;3;False;Valkoinen suklaa;12 - 100 g bars;30;23;16.2500;65;0 52 | 51;7;False;Manjimup Dried Apples;50 - 300 g pkgs.;10;24;53.0000;20;0 53 | 52;5;False;Filo Mix;16 - 2 kg boxes;25;24;7.0000;38;0 54 | 53;6;True;Perth Pasties;48 pieces;0;24;32.8000;0;0 55 | 54;6;False;Tourtière;16 pies;10;25;7.4500;21;0 56 | 55;6;False;Pâté chinois;24 boxes x 2 pies;20;25;24.0000;115;0 57 | 56;5;False;Gnocchi di nonna Alice;24 - 250 g pkgs.;30;26;38.0000;21;10 58 | 57;5;False;Ravioli Angelo;24 - 250 g pkgs.;20;26;19.5000;36;0 59 | 58;8;False;Escargots de Bourgogne;24 pieces;20;27;13.2500;62;0 60 | 59;4;False;Raclette Courdavault;5 kg pkg.;0;28;55.0000;79;0 61 | 60;4;False;Camembert Pierrot;15 - 300 g rounds;0;28;34.0000;19;0 62 | 61;2;False;Sirop d'érable;24 - 500 ml bottles;25;29;28.5000;113;0 63 | 62;3;False;Tarte au sucre;48 pies;0;29;49.3000;17;0 64 | 63;2;False;Vegie-spread;15 - 625 g jars;5;7;43.9000;24;0 65 | 64;5;False;Wimmers gute Semmelknödel;20 bags x 4 pieces;30;12;33.2500;22;80 66 | 65;2;False;Louisiana Fiery Hot Pepper Sauce;32 - 8 oz bottles;0;2;21.0500;76;0 67 | 66;2;False;Louisiana Hot Spiced Okra;24 - 8 oz jars;20;2;17.0000;4;100 68 | 67;1;False;Laughing Lumberjack Lager;24 - 12 oz bottles;10;16;14.0000;52;0 69 | 68;3;False;Scottish Longbreads;10 boxes x 8 pieces;15;8;12.5000;6;10 70 | 69;4;False;Gudbrandsdalsost;10 kg pkg.;15;15;36.0000;26;0 71 | 70;1;False;Outback Lager;24 - 355 ml bottles;30;7;15.0000;15;10 72 | 71;4;False;Flotemysost;10 - 500 g pkgs.;0;15;21.5000;26;0 73 | 72;4;False;Mozzarella di Giovanni;24 - 200 g pkgs.;0;14;34.8000;14;0 74 | 73;8;False;Röd Kaviar;24 - 150 g jars;5;17;15.0000;101;0 75 | 74;7;False;Longlife Tofu;5 kg pkg.;5;4;10.0000;4;20 76 | 75;1;False;Rhönbräu Klosterbier;24 - 0.5 l bottles;25;12;7.7500;125;0 77 | 76;1;False;Lakkalikööri;500 ml;20;23;18.0000;57;0 78 | 77;2;False;Original Frankfurter grüne Soße;12 boxes;15;12;13.0000;32;0 79 | -------------------------------------------------------------------------------- /optional-self-hosted-backend/db/schema.cds: -------------------------------------------------------------------------------- 1 | namespace my.northwind; 2 | 3 | entity Products { 4 | key ProductID: Integer; 5 | ProductName: String; 6 | SupplierID: Integer; 7 | CategoryID: Integer; 8 | QuantityPerUnit: String; 9 | UnitPrice: Decimal; 10 | UnitsInStock: Integer; 11 | UnitsOnOrder: Integer; 12 | ReorderLevel: Integer; 13 | Discontinued: Boolean; 14 | Supplier: Association to Suppliers; 15 | } 16 | 17 | entity Suppliers { 18 | key SupplierID: Integer; 19 | Products: Association to Products; 20 | } 21 | -------------------------------------------------------------------------------- /optional-self-hosted-backend/db/src/.hdiconfig: -------------------------------------------------------------------------------- 1 | { 2 | "file_suffixes": { 3 | "csv": { 4 | "plugin_name": "com.sap.hana.di.tabledata.source" 5 | }, 6 | "hdbafllangprocedure": { 7 | "plugin_name": "com.sap.hana.di.afllangprocedure" 8 | }, 9 | "hdbanalyticprivilege": { 10 | "plugin_name": "com.sap.hana.di.analyticprivilege" 11 | }, 12 | "hdbcalculationview": { 13 | "plugin_name": "com.sap.hana.di.calculationview" 14 | }, 15 | "hdbcollection": { 16 | "plugin_name": "com.sap.hana.di.collection" 17 | }, 18 | "hdbconstraint": { 19 | "plugin_name": "com.sap.hana.di.constraint" 20 | }, 21 | "hdbdropcreatetable": { 22 | "plugin_name": "com.sap.hana.di.dropcreatetable" 23 | }, 24 | "hdbflowgraph": { 25 | "plugin_name": "com.sap.hana.di.flowgraph" 26 | }, 27 | "hdbfunction": { 28 | "plugin_name": "com.sap.hana.di.function" 29 | }, 30 | "hdbgraphworkspace": { 31 | "plugin_name": "com.sap.hana.di.graphworkspace" 32 | }, 33 | "hdbhadoopmrjob": { 34 | "plugin_name": "com.sap.hana.di.virtualfunctionpackage.hadoop" 35 | }, 36 | "hdbindex": { 37 | "plugin_name": "com.sap.hana.di.index" 38 | }, 39 | "hdblibrary": { 40 | "plugin_name": "com.sap.hana.di.library" 41 | }, 42 | "hdbmigrationtable": { 43 | "plugin_name": "com.sap.hana.di.table.migration" 44 | }, 45 | "hdbprocedure": { 46 | "plugin_name": "com.sap.hana.di.procedure" 47 | }, 48 | "hdbprojectionview": { 49 | "plugin_name": "com.sap.hana.di.projectionview" 50 | }, 51 | "hdbprojectionviewconfig": { 52 | "plugin_name": "com.sap.hana.di.projectionview.config" 53 | }, 54 | "hdbreptask": { 55 | "plugin_name": "com.sap.hana.di.reptask" 56 | }, 57 | "hdbresultcache": { 58 | "plugin_name": "com.sap.hana.di.resultcache" 59 | }, 60 | "hdbrole": { 61 | "plugin_name": "com.sap.hana.di.role" 62 | }, 63 | "hdbroleconfig": { 64 | "plugin_name": "com.sap.hana.di.role.config" 65 | }, 66 | "hdbsearchruleset": { 67 | "plugin_name": "com.sap.hana.di.searchruleset" 68 | }, 69 | "hdbsequence": { 70 | "plugin_name": "com.sap.hana.di.sequence" 71 | }, 72 | "hdbstatistics": { 73 | "plugin_name": "com.sap.hana.di.statistics" 74 | }, 75 | "hdbstructuredprivilege": { 76 | "plugin_name": "com.sap.hana.di.structuredprivilege" 77 | }, 78 | "hdbsynonym": { 79 | "plugin_name": "com.sap.hana.di.synonym" 80 | }, 81 | "hdbsynonymconfig": { 82 | "plugin_name": "com.sap.hana.di.synonym.config" 83 | }, 84 | "hdbsystemversioning": { 85 | "plugin_name": "com.sap.hana.di.systemversioning" 86 | }, 87 | "hdbtable": { 88 | "plugin_name": "com.sap.hana.di.table" 89 | }, 90 | "hdbtabledata": { 91 | "plugin_name": "com.sap.hana.di.tabledata" 92 | }, 93 | "hdbtabletype": { 94 | "plugin_name": "com.sap.hana.di.tabletype" 95 | }, 96 | "hdbtrigger": { 97 | "plugin_name": "com.sap.hana.di.trigger" 98 | }, 99 | "hdbview": { 100 | "plugin_name": "com.sap.hana.di.view" 101 | }, 102 | "hdbvirtualfunction": { 103 | "plugin_name": "com.sap.hana.di.virtualfunction" 104 | }, 105 | "hdbvirtualfunctionconfig": { 106 | "plugin_name": "com.sap.hana.di.virtualfunction.config" 107 | }, 108 | "hdbvirtualpackagehadoop": { 109 | "plugin_name": "com.sap.hana.di.virtualpackage.hadoop" 110 | }, 111 | "hdbvirtualpackagesparksql": { 112 | "plugin_name": "com.sap.hana.di.virtualpackage.sparksql" 113 | }, 114 | "hdbvirtualprocedure": { 115 | "plugin_name": "com.sap.hana.di.virtualprocedure" 116 | }, 117 | "hdbvirtualprocedureconfig": { 118 | "plugin_name": "com.sap.hana.di.virtualprocedure.config" 119 | }, 120 | "hdbvirtualtable": { 121 | "plugin_name": "com.sap.hana.di.virtualtable" 122 | }, 123 | "hdbvirtualtableconfig": { 124 | "plugin_name": "com.sap.hana.di.virtualtable.config" 125 | }, 126 | "properties": { 127 | "plugin_name": "com.sap.hana.di.tabledata.properties" 128 | }, 129 | "tags": { 130 | "plugin_name": "com.sap.hana.di.tabledata.properties" 131 | }, 132 | "txt": { 133 | "plugin_name": "com.sap.hana.di.copyonly" 134 | }, 135 | "hdbeshconfig": { 136 | "plugin_name": "com.sap.hana.di.eshconfig" 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /optional-self-hosted-backend/db/undeploy.json: -------------------------------------------------------------------------------- 1 | [ 2 | "src/gen/**/*.hdbview", 3 | "src/gen/**/*.hdbindex", 4 | "src/gen/**/*.hdbconstraint", 5 | "src/gen/**/*_drafts.hdbtable", 6 | "src/gen/**/*.hdbcalculationview" 7 | ] 8 | -------------------------------------------------------------------------------- /optional-self-hosted-backend/mta.yaml: -------------------------------------------------------------------------------- 1 | _schema-version: "3.1" 2 | ID: "sample-northwind-cap" 3 | version: 1.0.0 4 | description: "A sample CAP project that mocks the Northwind OData service." 5 | parameters: 6 | enable-parallel-deployments: true 7 | 8 | build-parameters: 9 | before-all: 10 | - builder: custom 11 | commands: 12 | - npx cds build --production 13 | 14 | modules: 15 | - name: sample-northwind-cap-srv 16 | type: nodejs 17 | path: gen/srv 18 | build-parameters: 19 | ignore: 20 | - "default-env.json" 21 | - "node_modules/" 22 | parameters: 23 | buildpack: nodejs_buildpack 24 | memory: 256M 25 | disk-quota: 1GB 26 | requires: 27 | - name: sample-northwind-cap-db 28 | - name: managed-fiori-uaa 29 | provides: 30 | - name: srv-api 31 | properties: 32 | srv-url: ${default-url} 33 | 34 | - name: sample-northwind-cap-db-deployer 35 | type: hdb 36 | path: gen/db 37 | build-parameters: 38 | ignore: 39 | - "default-env.json" 40 | - "node_modules/" 41 | parameters: 42 | buildpack: nodejs_buildpack 43 | memory: 256M 44 | disk-quota: 256M 45 | requires: 46 | - name: sample-northwind-cap-db 47 | 48 | resources: 49 | # services extracted from CAP configuration 50 | # 'service-plan' can be configured via 'cds.requires..vcap.plan' 51 | # ------------------------------------------------------------ 52 | - name: sample-northwind-cap-db 53 | # ------------------------------------------------------------ 54 | type: com.sap.xs.hdi-container 55 | parameters: 56 | service: hana # or 'hanatrial' on trial landscapes 57 | service-plan: hdi-shared 58 | properties: 59 | hdi-service-name: ${service-name} 60 | 61 | # manually add to replace the original destination deployed by 62 | # managed-html5-runtime-fiori-mta 63 | - name: sample-manage-products-destination 64 | type: org.cloudfoundry.managed-service 65 | requires: 66 | - name: srv-api 67 | parameters: 68 | service-plan: lite 69 | service: destination 70 | config: 71 | init_data: 72 | instance: 73 | existing_destinations_policy: update 74 | destinations: 75 | - Name: Northwind 76 | Description: Self-hosted CAP backend instead of Northwind service 77 | Authentication: NoAuthentication 78 | ProxyType: Internet 79 | Type: HTTP 80 | URL: ~{srv-api/srv-url} 81 | HTML5.DynamicDestination: true 82 | HTML5.ForwardAuthToken: true 83 | 84 | # manually add to bind to the xsuaa service deployed by 85 | # managed-html5-runtime-fiori-mta 86 | - name: sample-manage-products-auth 87 | type: org.cloudfoundry.existing-service 88 | parameters: 89 | service-name: sample-manage-products-auth 90 | -------------------------------------------------------------------------------- /optional-self-hosted-backend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sample-northwind-cap", 3 | "version": "1.0.0", 4 | "description": "A sample CAP project that mocks the Northwind OData service.", 5 | "repository": "", 6 | "license": "UNLICENSED", 7 | "private": true, 8 | "dependencies": { 9 | "@cap-js-community/odata-v2-adapter": "^1.14.3", 10 | "@sap/cds": "^8", 11 | "@sap/xsenv": "latest", 12 | "@sap/xssec": "latest", 13 | "express": "^4", 14 | "passport": "^0.6.0", 15 | "@cap-js/hana": "^1" 16 | }, 17 | "scripts": { 18 | "start": "cds-serve", 19 | "build": "mbt build --mtar sample-northwind-cap", 20 | "deploy": "cf deploy mta_archives/sample-northwind-cap.mtar" 21 | }, 22 | "devDependencies": { 23 | "@cap-js/sqlite": "^1" 24 | }, 25 | "cds": { 26 | "sql": { 27 | "native_hana_associations": false 28 | }, 29 | "cov2ap": { 30 | "plugin": true 31 | }, 32 | "requires": { 33 | "auth": { 34 | "kind": "mocked" 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /optional-self-hosted-backend/srv/service.cds: -------------------------------------------------------------------------------- 1 | using my.northwind as my from '../db/schema'; 2 | 3 | @protocol: [ 4 | { 5 | kind: 'odata-v4', 6 | path: '/Northwind/Northwind.svc' 7 | }, 8 | { 9 | kind: 'odata-v2', 10 | path: '/v2/Northwind/Northwind.svc' 11 | } 12 | ] 13 | service Northwind.svc { 14 | @readonly 15 | entity Products as projection on my.Products; 16 | entity Suppliers as projection on my.Suppliers; 17 | } 18 | -------------------------------------------------------------------------------- /standalone-approuter-html5-local-dir/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-approuter-html5-local-dir/diagram.png -------------------------------------------------------------------------------- /standalone-approuter-html5-local-dir/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "appouter", 3 | "description": "Node.js based application router service for html5-apps", 4 | "dependencies": { 5 | "@sap/approuter": "latest" 6 | }, 7 | "scripts": { 8 | "start": "node node_modules/@sap/approuter/approuter.js" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /standalone-approuter-html5-local-dir/readme.md: -------------------------------------------------------------------------------- 1 | # On Standalone Application Router 2 | 3 | ## Diagram 4 | 5 | ![diagram](diagram.png) 6 | 7 | ## Description 8 | 9 | This is an example of an HTML5 app that you maintain on a standalone application router in your own space. The app is directly embedded into your subaccount on the Cloud Foundry environment. That means the static content of the is **not** stored and managed in the HTML5 Application Repository of SAP BTP. 10 | 11 | 12 | ## Download and Installation 13 | 1. Download the source code: 14 | ``` 15 | git clone https://github.com/SAP-samples/multi-cloud-html5-apps-samples 16 | cd multi-cloud-html5-apps-samples/standalone-approuter-html5-local-dir 17 | ``` 18 | 3. Deploy the application router: 19 | ``` 20 | cf push approuter --random-route 21 | ``` 22 | 23 | If the deployment has been successful, you find the URL of the application router in the console output. or you can print it on Unix-based systems with `cf app approuter | awk '/^routes/ { print "https://"$2"/" }'`. It has the following structure: 24 | 25 | . 26 | 27 | 28 | ## Configuration 29 | To change path to the default app, edit the `welcomeFile` property in the [`xs-app.json`](router/xs-app.json) configuration file of the app router. You can replace the content of `webapp` to embed another web app in the application router. 30 | 31 | 32 | ## Check the Result 33 | 34 | ### List the Deployed Applications 35 | 36 | ``` 37 | $ cf apps 38 | Getting apps in org 9f10ed8atrial / space dev as firstname.lastname@domain.com... 39 | OK 40 | 41 | name requested state instances memory disk urls 42 | approuter started 1/1 1G 1G approuter-hilarious-bear-ur.cfapps.us10.hana.ondemand.com 43 | ``` 44 | 45 | ### Check the HTML5 App 46 | 47 | Access the URL to check the web app. 48 | ![webapp](result.png) -------------------------------------------------------------------------------- /standalone-approuter-html5-local-dir/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-approuter-html5-local-dir/result.png -------------------------------------------------------------------------------- /standalone-approuter-html5-local-dir/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | This is title 4 |
5 | 6 | 7 | Hello world 8 | 9 | 10 | -------------------------------------------------------------------------------- /standalone-approuter-html5-local-dir/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/index.html", 3 | "authenticationMethod": "none", 4 | "routes": [ 5 | { 6 | "source": "(.*)", 7 | "localDir": "webapp" 8 | } 9 | ] 10 | } -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/approuter/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "appouter", 3 | "description": "Node.js based application router service for html5-apps", 4 | "dependencies": { 5 | "@sap/approuter": "latest" 6 | }, 7 | "scripts": { 8 | "start": "node node_modules/@sap/approuter/approuter.js" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/approuter/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/index.html", 3 | "authenticationMethod": "route", 4 | "routes": [ 5 | { 6 | "source": "/user-api/currentUser$", 7 | "target": "/currentUser", 8 | "service": "sap-approuter-userapi" 9 | }, 10 | { 11 | "source": "(.*)", 12 | "target": "ui5webcomponents/$1", 13 | "service": "html5-apps-repo-rt", 14 | "authenticationType": "xsuaa" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-approuter-html5-mta-ui5webcomponents/diagram.png -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/mta.yaml: -------------------------------------------------------------------------------- 1 | ID: standalone-approuter-ui5webcomponents 2 | _schema-version: "2.1" 3 | version: 1.0.0 4 | 5 | modules: 6 | - name: approuter 7 | type: approuter.nodejs 8 | path: approuter 9 | parameters: 10 | disk-quota: 256M 11 | memory: 256M 12 | requires: 13 | - name: html5_repo_runtime 14 | - name: html5_destination 15 | - name: html5_uaa 16 | - name: ui5webcomponents 17 | type: html5 18 | path: ui5webcomponents 19 | build-parameters: 20 | builder: custom 21 | commands: 22 | - npm run build 23 | supported-platforms: [] 24 | - name: html5deployer 25 | type: com.sap.application.content 26 | path: . 27 | requires: 28 | - name: html5_repo_host 29 | parameters: 30 | content-target: true 31 | build-parameters: 32 | build-result: resources 33 | requires: 34 | - artifacts: 35 | - ui5webcomponents.zip 36 | name: ui5webcomponents 37 | target-path: resources/ 38 | 39 | resources: 40 | - name: html5_repo_host 41 | type: org.cloudfoundry.managed-service 42 | parameters: 43 | service: html5-apps-repo 44 | service-plan: app-host 45 | - name: html5_repo_runtime 46 | type: org.cloudfoundry.managed-service 47 | parameters: 48 | service: html5-apps-repo 49 | service-plan: app-runtime 50 | 51 | 52 | - name: html5_destination 53 | type: org.cloudfoundry.managed-service 54 | parameters: 55 | service-plan: lite 56 | service: destination 57 | - name: html5_uaa 58 | parameters: 59 | path: ./xs-security.json 60 | service-plan: application 61 | service: xsuaa 62 | type: org.cloudfoundry.managed-service 63 | -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "standalone-approuter-ui5webcomponents", 3 | "dependencies": { 4 | "mbt": "^1.2.7" 5 | }, 6 | "scripts": { 7 | "build": "mbt build" 8 | }, 9 | "version": "1.0.0" 10 | } 11 | -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/readme.md: -------------------------------------------------------------------------------- 1 | # Standalone Application Router, Using HTML5 Application Repository with UI5 Web Components, XSUAA Service, and Destination Service 2 | 3 | ## Diagram 4 | 5 | ![diagram](diagram.png) 6 | 7 | ## Description 8 | This is an example of an HTML5 app built with UI5 Web Components that you maintain on a standalone application router in your own space in the Cloud Foundry environment. The app is deployed to the HTML5 Application Repository and uses the Authentication & Authorization service (XSUAA service), the destination service, and the User API service. 9 | 10 | 11 | ## Download and Installation 12 | 1. Download the source code: 13 | ``` 14 | git clone https://github.com/SAP-samples/multi-cloud-html5-apps-samples 15 | cd multi-cloud-html5-apps-samples/standalone-approuter-html5-mta-ui5webcomponents 16 | ``` 17 | 2. Build the project: 18 | ``` 19 | npm install 20 | npm run build 21 | ``` 22 | 3. Deploy the project: 23 | ``` 24 | cf deploy mta_archives/standalone-approuter-ui5webcomponents_1.0.0.mtar 25 | ``` 26 | 27 | If the deployment has been successful, you find the URL of the application router in the console output or you can print it on Unix-based systems with `cf app approuter | awk '/^routes/ { print "https://"$2"/" }'`. It probably has the following structure: . 28 | 29 | 30 | ## Configuration 31 | 32 | You can replace the content of the `ui5webcomponents` folder with your own HTML5 app. Please note that the `html5deployer` expects a zipped version of your build result (in our case the build result is our `dist` folder). Check the build script at [`package.json`](ui5webcomponents/package.json) to see an example of that. Keep in mind that your app id in the `manifest.json` has to match the target for path `^(.*)` (all incoming requests) in the [`xs-app.json`](approuter/xs-app.json). 33 | 34 | ## Check the Result 35 | 36 | ### List the Deployed HTML5 App 37 | 38 | ``` 39 | $ cf html5-list 40 | Getting list of HTML5 applications in org [cf-org-name] / space dev as firstname.lastname@domain.com... 41 | OK 42 | 43 | name version app-host-id service instance visibility last changed 44 | ui5webcomponents 1.0.0 1db2ae23-90e9-4055-a22c-6865ca7ad73e html5_repo_host public Mon, 10 Aug 2020 13:26:03 GMT 45 | ``` 46 | 47 | ### List the Deployed MTA 48 | 49 | ``` 50 | $ cf mta standalone-approuter-ui5webcomponents_1.0.0.mtar 51 | Showing health and status for multi-target app standalone-approuter-ui5webcomponents_1.0.0.mtar in org [cf-org-name] / space dev as firstname.lastname@domain.com... 52 | OK 53 | Version: 1.0.0 54 | 55 | Apps: 56 | name requested state instances memory disk urls 57 | approuter started 1/1 256M 256M [cf-org-name]-dev-approuter.cfapps.eu10.hana.ondemand.com 58 | 59 | Services: 60 | name service plan bound apps last operation 61 | html5_destination destination lite approuter create succeeded 62 | html5_repo_host html5-apps-repo app-host create succeeded 63 | html5_repo_runtime html5-apps-repo app-runtime approuter create succeeded 64 | html5_uaa xsuaa application approuter create succeeded 65 | ``` 66 | 67 | ### Check the Web App 68 | 69 | Access the URL to view the web app. You are directed to a sign-on page before you can see the web app that displays your name. 70 | 71 | ![webapp](result.png) 72 | -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-approuter-html5-mta-ui5webcomponents/result.png -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/ui5webcomponents/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | UI5 Web Components 5 | 6 | 7 | 8 | 9 | Welcome to UI5 Web Components! 10 |

11 | 12 | 13 | Adding more components? Check the sample page of the component and add the 14 | corresponding import statement in `src/index.js` 15 | 16 |

17 | 18 | 19 |

20 | 21 | Positive 22 | Negative 23 |

24 | 25 | 26 |
27 | Open Dialog 28 |
29 | 30 | 31 |
32 | Hello World! 33 | Dismiss 34 |
35 |
36 | Change Theme 37 |
38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/ui5webcomponents/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ui5webcomponents", 3 | "version": "1.0.0", 4 | "description": "", 5 | "engines": { 6 | "node": ">=0.12" 7 | }, 8 | "engineStrict": true, 9 | "scripts": { 10 | "start": "vite", 11 | "build": "npm run clean && vite build && npm run zip", 12 | "clean": "npx rimraf ui5webcomponents.zip dist", 13 | "zip": "cd dist/ && npx bestzip ../ui5webcomponents.zip *" 14 | }, 15 | "dependencies": { 16 | "@ui5/webcomponents": "^1.0.2" 17 | }, 18 | "devDependencies": { 19 | "vite": "^2.7.2" 20 | } 21 | } -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/ui5webcomponents/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "sap.app": { 3 | "id": "ui5webcomponents", 4 | "applicationVersion": { 5 | "version": "1.0.0" 6 | } 7 | }, 8 | "sap.cloud": { 9 | "public": true, 10 | "service": "cloud.service" 11 | } 12 | } -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/ui5webcomponents/public/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/index.html", 3 | "authenticationMethod": "route", 4 | "logout": { 5 | "logoutEndpoint": "/do/logout" 6 | }, 7 | "routes": [ 8 | { 9 | "source": "^(.*)$", 10 | "target": "$1", 11 | "service": "html5-apps-repo-rt", 12 | "authenticationType": "xsuaa" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/ui5webcomponents/src/index.js: -------------------------------------------------------------------------------- 1 | import "@ui5/webcomponents/dist/Button.js"; 2 | import "@ui5/webcomponents/dist/Label.js"; 3 | import "@ui5/webcomponents/dist/DatePicker.js"; 4 | import "@ui5/webcomponents/dist/MessageStrip.js"; 5 | import "@ui5/webcomponents/dist/Dialog.js"; 6 | import "@ui5/webcomponents/dist/Switch.js"; 7 | import "@ui5/webcomponents/dist/Title.js"; 8 | 9 | import { getTheme, setTheme } from "@ui5/webcomponents-base/dist/config/Theme.js"; 10 | import { } from "@ui5/webcomponents-base/dist/config/Theme.js"; 11 | import "@ui5/webcomponents/dist/Assets"; 12 | 13 | fetch("/user-api/currentUser").then((res) => { 14 | return res.json(); 15 | }).then((user) => { 16 | document.getElementById("title").textContent = `Hi ${user.firstname}, Welcome to UI5 Web Components!` 17 | }); 18 | 19 | function switchTheme() { 20 | if (getTheme() !== "sap_horizon") { 21 | setTheme("sap_horizon") 22 | } else { 23 | setTheme("sap_fiori_3") 24 | } 25 | 26 | displayTheme() 27 | } 28 | 29 | function displayTheme() { 30 | document.getElementById("myThemeLabel").textContent = `Current Theme: ${getTheme()}` 31 | } 32 | 33 | displayTheme() 34 | 35 | const themeBtn = document.getElementById("themeDialogButton") 36 | themeBtn.addEventListener("click", () => { 37 | switchTheme() 38 | }); 39 | 40 | const openBtn = document.getElementById("openDialogButton"); 41 | const closeBtn = document.getElementById("closeDialogButton"); 42 | const dialog = document.getElementById("hello-dialog"); 43 | openBtn.addEventListener("click", () => { 44 | dialog.show(); 45 | }); 46 | closeBtn.addEventListener("click", () => { 47 | dialog.close(); 48 | }); -------------------------------------------------------------------------------- /standalone-approuter-html5-mta-ui5webcomponents/xs-security.json: -------------------------------------------------------------------------------- 1 | { 2 | "xsappname": "html5_approuter", 3 | "tenant-mode": "dedicated", 4 | "description": "Security profile of called application", 5 | "scopes": [ 6 | { 7 | "name": "uaa.user", 8 | "description": "UAA" 9 | } 10 | ], 11 | "role-templates": [ 12 | { 13 | "name": "Token_Exchange", 14 | "description": "UAA", 15 | "scope-references": [ 16 | "uaa.user" 17 | ] 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/HTML5Module/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | Welcome 4 | 5 |
6 | 7 | 16 | 17 | 18 | Hi there 👋 19 | 20 | 21 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/HTML5Module/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "1.12.0", 3 | "sap.app": { 4 | "id": "hello-world-approuter", 5 | "applicationVersion": { 6 | "version": "1.0.0" 7 | } 8 | }, 9 | "sap.cloud": { 10 | "public": true, 11 | "service": "cloud.service" 12 | } 13 | } -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/HTML5Module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "html5module", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "build": "npm run clean && npm run zip", 6 | "zip": "npx bestzip HTML5Module-content.zip *", 7 | "clean": "npx rimraf HTML5Module-content.zip dist" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/HTML5Module/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/index.html", 3 | "authenticationMethod": "route", 4 | "logout": { 5 | "logoutEndpoint": "/do/logout" 6 | }, 7 | "routes": [ 8 | { 9 | "source": "^(.*)$", 10 | "target": "$1", 11 | "service": "html5-apps-repo-rt", 12 | "authenticationType": "xsuaa" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-approuter-html5-runtime-mta-hello-world/diagram.png -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/mta.yaml: -------------------------------------------------------------------------------- 1 | ID: standalone-hello-world 2 | _schema-version: "2.1" 3 | version: 1.0.0 4 | 5 | modules: 6 | - name: html5_app_router 7 | type: approuter.nodejs 8 | path: router 9 | parameters: 10 | disk-quota: 256M 11 | memory: 256M 12 | requires: 13 | - name: html5_repo_runtime 14 | - name: html5_destination 15 | - name: html5_uaa 16 | - name: html5_deployer 17 | type: com.sap.application.content 18 | path: . 19 | requires: 20 | - name: html5_repo_host 21 | parameters: 22 | content-target: true 23 | build-parameters: 24 | build-result: resources 25 | requires: 26 | - artifacts: 27 | - HTML5Module-content.zip 28 | name: HTML5Module 29 | target-path: resources/ 30 | - name: HTML5Module 31 | type: html5 32 | path: HTML5Module 33 | build-parameters: 34 | builder: custom 35 | commands: 36 | - npm run build 37 | supported-platforms: [] 38 | resources: 39 | - name: html5_repo_host 40 | type: org.cloudfoundry.managed-service 41 | parameters: 42 | service: html5-apps-repo 43 | service-plan: app-host 44 | - name: html5_repo_runtime 45 | parameters: 46 | service-plan: app-runtime 47 | service: html5-apps-repo 48 | type: org.cloudfoundry.managed-service 49 | - name: html5_destination 50 | type: org.cloudfoundry.managed-service 51 | parameters: 52 | service-plan: lite 53 | service: destination 54 | - name: html5_uaa 55 | parameters: 56 | path: ./xs-security.json 57 | service-plan: application 58 | service: xsuaa 59 | type: org.cloudfoundry.managed-service 60 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "approuter_destination_uaa_html5", 3 | "description": "Node.js based application router service for html5-apps", 4 | "dependencies": { 5 | "mbt": "^1.2.7" 6 | }, 7 | "scripts": { 8 | "build": "mbt build" 9 | }, 10 | "version": "1.0.0" 11 | } 12 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/readme.md: -------------------------------------------------------------------------------- 1 | # On Standalone Application Router, Using HTML5 Application Repository, XSUAA Service, and Destination Service 2 | 3 | ## Diagram 4 | 5 | ![diagram](diagram.png) 6 | 7 | ## Description 8 | This is an example of an HTML5 app that you maintain on a standalone application router in your own space in the Cloud Foundry environment. The app is deployed to the HTML Application Repository and uses the Authentication & Authorization service (XSUAA service), the destination service, and the User API service. 9 | 10 | 11 | ## Download and Installation 12 | 1. Download the source code: 13 | ``` 14 | git clone https://github.com/SAP-samples/multi-cloud-html5-apps-samples 15 | cd multi-cloud-html5-apps-samples/standalone-approuter-html5-runtime-mta-hello-world 16 | ``` 17 | 2. Build the project: 18 | ``` 19 | npm install 20 | npm run build 21 | ``` 22 | 3. Deploy the project: 23 | ``` 24 | cf deploy mta_archives/standalone-hello-world_1.0.0.mtar 25 | ``` 26 | 27 | If the deployment has been successful, you find the URL of the application router in the console output or you can print it on Unix-based systems with `cf app html5_app_router | awk '/^routes/ { print "https://"$2"/" }'`. It probably has the following structure: . 28 | 29 | 30 | ## Configuration 31 | 32 | You can replace the content of the `HTML5Module` folder with your own HTML5 app. Keep in mind that you also need to change the path to the default app if your web app has a different ID. 33 | 34 | To change the path to the default app, edit the `welcomeFile` property in the [`xs-app.json`](router/xs-app.json) configuration file of the application router. 35 | 36 | ## Check the Result 37 | 38 | ### List the Deployed HTML5 App 39 | 40 | ``` 41 | $ cf html5-list 42 | Getting list of HTML5 applications in org 9f10ed8atrial / space dev as firstname.lastname@domain.com... 43 | OK 44 | 45 | name version app-host-id service instance visibility last changed 46 | helloworld 1.0.0 1db2ae23-90e9-4055-a22c-6865ca7ad73e html5_repo_host public Mon, 10 Aug 2020 13:26:03 GMT 47 | ``` 48 | 49 | ### List the Deployed MTA 50 | 51 | ``` 52 | $ cf mta standalone-hello-world 53 | Showing health and status for multi-target app standalone-hello-world in org 9f10ed8atrial / space dev as firstname.lastname@domain.com... 54 | OK 55 | Version: 1.0.0 56 | 57 | Apps: 58 | name requested state instances memory disk urls 59 | html5_app_router started 1/1 256M 256M 9f10ed8atrial-dev-html5-app-router.cfapps.us10.hana.ondemand.com 60 | 61 | Services: 62 | name service plan bound apps last operation 63 | html5_destination destination lite html5_app_router create succeeded 64 | html5_repo_host html5-apps-repo app-host create succeeded 65 | html5_repo_runtime html5-apps-repo app-runtime html5_app_router create succeeded 66 | html5_uaa xsuaa application html5_app_router create succeeded 67 | ``` 68 | 69 | ### Check the Web App 70 | 71 | Access the URL to view the web app. You are directed to a sign-on page before you can see the web app that display your name. 72 | 73 | ![webapp](result.png) 74 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-approuter-html5-runtime-mta-hello-world/result.png -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/router/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "appouter", 3 | "description": "Node.js based application router service for html5-apps", 4 | "dependencies": { 5 | "@sap/approuter": "latest" 6 | }, 7 | "scripts": { 8 | "start": "node node_modules/@sap/approuter/approuter.js" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/router/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/index.html", 3 | "authenticationMethod": "route", 4 | "routes": [ 5 | { 6 | "source": "/user-api/currentUser$", 7 | "target": "/currentUser", 8 | "service": "sap-approuter-userapi" 9 | }, 10 | { 11 | "source": "(.*)", 12 | "target": "/helloworldapprouter/$1", 13 | "service": "html5-apps-repo-rt" 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime-mta-hello-world/xs-security.json: -------------------------------------------------------------------------------- 1 | { 2 | "xsappname": "html5_app_repo_router", 3 | "tenant-mode": "dedicated", 4 | "description": "Security profile of called application", 5 | "scopes": [ 6 | { 7 | "name": "uaa.user", 8 | "description": "UAA" 9 | } 10 | ], 11 | "role-templates": [ 12 | { 13 | "name": "Token_Exchange", 14 | "description": "UAA", 15 | "scope-references": [ 16 | "uaa.user" 17 | ] 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime/HTML5Module/index.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | This is title 4 |
5 | 6 | 7 | Hello world 8 | 9 | 10 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime/HTML5Module/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "1.12.0", 3 | "sap.app": { 4 | "id": "hello-world", 5 | "applicationVersion": { 6 | "version": "1.0.0" 7 | } 8 | }, 9 | "sap.cloud": { 10 | "public": true, 11 | "service": "cloud.service" 12 | } 13 | } -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime/HTML5Module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "html5module", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "build": "npm run clean && npm run zip", 6 | "zip": "npx bestzip HTML5Module-content.zip *", 7 | "clean": "npx rimraf HTML5Module-content.zip dist" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime/HTML5Module/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/index.html", 3 | "authenticationMethod": "none", 4 | "routes": [ 5 | { 6 | "source": "^(.*)$", 7 | "target": "$1", 8 | "service": "html5-apps-repo-rt", 9 | "authenticationType": "none" 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-approuter-html5-runtime/diagram.png -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime/mta.yaml: -------------------------------------------------------------------------------- 1 | ID: approuter_html5 2 | _schema-version: "2.1" 3 | version: 1.0.0 4 | modules: 5 | - name: html5_app_router 6 | type: approuter.nodejs 7 | path: router 8 | parameters: 9 | disk-quota: 256M 10 | memory: 256M 11 | requires: 12 | - name: html5_repo_runtime 13 | - name: html5_deployer 14 | type: com.sap.application.content 15 | path: . 16 | requires: 17 | - name: html5_repo_host 18 | parameters: 19 | content-target: true 20 | build-parameters: 21 | build-result: resources 22 | requires: 23 | - artifacts: 24 | - HTML5Module-content.zip 25 | name: HTML5Module 26 | target-path: resources/ 27 | - name: HTML5Module 28 | type: html5 29 | path: HTML5Module 30 | build-parameters: 31 | builder: custom 32 | commands: 33 | - npm run build 34 | supported-platforms: [] 35 | resources: 36 | - name: html5_repo_host 37 | type: org.cloudfoundry.managed-service 38 | parameters: 39 | service: html5-apps-repo 40 | service-plan: app-host 41 | - name: html5_repo_runtime 42 | type: org.cloudfoundry.managed-service 43 | parameters: 44 | service-plan: app-runtime 45 | service: html5-apps-repo 46 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "approuter_html5", 3 | "description": "Node.js based application router service for html5-apps", 4 | "dependencies": { 5 | "mbt": "^1.2.7" 6 | }, 7 | "scripts": { 8 | "build": "mbt build" 9 | }, 10 | "version": "1.0.0" 11 | } 12 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime/readme.md: -------------------------------------------------------------------------------- 1 | # On Standalone Application Router using HTML5 Application Repository 2 | 3 | ## Diagram 4 | 5 | ![diagram](diagram.png) 6 | 7 | ## Description 8 | 9 | This is an example of an HTML5 app that you maintain on a standalone application router in your own space in the Cloud Foundry environment. The app is deployed to the HTML Application Repository. 10 | 11 | 12 | ## Download and Installation 13 | 1. Download the source code: 14 | ``` 15 | git clone https://github.com/SAP-samples/multi-cloud-html5-apps-samples 16 | cd multi-cloud-html5-apps-samples/standalone-approuter-html5-runtime 17 | ``` 18 | 2. Build the project: 19 | ``` 20 | npm install 21 | npm run build 22 | ``` 23 | 3. Deploy the project: 24 | ``` 25 | cf deploy mta_archives/approuter_html5_1.0.0.mtar 26 | ``` 27 | 28 | If the deployment has been successful, you find the URL of the application router in the console output or you can print it on Unix-based systems with `cf app standaloneportalmta | awk '/^routes/ { print "https://"$2"/" }'`. It probably has the following structure: . 29 | 30 | ## Configuration 31 | You can replace the content of the `HTML5Module` folder with your own web app. Keep in mind that you also need to change the path to the default app if your web app has a different ID. 32 | 33 | To change the path to the default app, edit the `welcomeFile` property in the [`xs-app.json`](router/xs-app.json) configuration file of the application router. 34 | 35 | ## Check the Result 36 | 37 | ### List the Deployed HTML5 App 38 | 39 | ``` 40 | $ cf html5-list 41 | Getting list of HTML5 applications in org 9f10ed8atrial / space dev as firstname.lastname@domain.com... 42 | OK 43 | 44 | name version app-host-id service instance visibility last changed 45 | helloworld 1.0.0 1db2ae23-90e9-4055-a22c-6865ca7ad73e html5_repo_host public Mon, 10 Aug 2020 13:26:03 GMT 46 | ``` 47 | 48 | ### List the Deployed MTA 49 | 50 | ``` 51 | $ cf mta approuter_html5 52 | Showing health and status for multi-target app approuter_html5 in org 9f10ed8atrial / space dev as firstname.lastname@domain.com... 53 | OK 54 | Version: 1.0.0 55 | 56 | Apps: 57 | name requested state instances memory disk urls 58 | html5_app_router started 1/1 256M 256M 9f10ed8atrial-dev-html5-app-router.cfapps.us10.hana.ondemand.com 59 | 60 | Services: 61 | name service plan bound apps last operation 62 | html5_repo_host html5-apps-repo app-host create succeeded 63 | html5_repo_runtime html5-apps-repo app-runtime html5_app_router create succeeded 64 | ``` 65 | 66 | ### Check the Web App 67 | 68 | Access the URL to view the web app. 69 | 70 | ![webapp](result.png) -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-approuter-html5-runtime/result.png -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime/router/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "appouter", 3 | "description": "Node.js based application router service for html5-apps", 4 | "dependencies": { 5 | "@sap/approuter": "latest" 6 | }, 7 | "scripts": { 8 | "start": "node node_modules/@sap/approuter/approuter.js" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /standalone-approuter-html5-runtime/router/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/helloworld/index.html", 3 | "authenticationMethod": "none", 4 | "routes": [] 5 | } -------------------------------------------------------------------------------- /standalone-mtx-approuter/HTML5Module/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | MTX Guestbook 11 | 14 | 15 | 20 | 89 | 90 | 91 | 92 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /standalone-mtx-approuter/HTML5Module/logout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Logout 4 | 5 | 6 |

Logout

7 |

You are now logged out!

8 |

You may return to the application

9 | 10 | -------------------------------------------------------------------------------- /standalone-mtx-approuter/HTML5Module/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "1.12.0", 3 | "sap.app": { 4 | "id": "mtx-guestbook", 5 | "type": "application", 6 | "applicationVersion": { 7 | "version": "1.0.0" 8 | } 9 | }, 10 | "sap.cloud": { 11 | "service": "cloud.service" 12 | } 13 | } -------------------------------------------------------------------------------- /standalone-mtx-approuter/HTML5Module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "html5module", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "build": "npm run clean && npm run zip", 6 | "zip": "npx bestzip HTML5Module-content.zip *", 7 | "clean": "npx rimraf HTML5Module-content.zip dist" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /standalone-mtx-approuter/HTML5Module/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "routes": [] 3 | } -------------------------------------------------------------------------------- /standalone-mtx-approuter/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-mtx-approuter/diagram.png -------------------------------------------------------------------------------- /standalone-mtx-approuter/mta.yaml: -------------------------------------------------------------------------------- 1 | ID: mtx-guestbook 2 | _schema-version: "2.1" 3 | version: 1.0.0 4 | 5 | parameters: 6 | appname: mtx-guestbook 7 | subdomain: 8 | 9 | modules: 10 | - name: mtx-approuter 11 | type: approuter.nodejs 12 | path: router 13 | parameters: 14 | routes: 15 | - route: https://${subdomain}-${appname}.${default-domain} 16 | - route: https://-${appname}.${default-domain} 17 | disk-quota: 256M 18 | memory: 256M 19 | requires: 20 | - name: html5-rt 21 | - name: uaa 22 | - name: saas-registry 23 | properties: 24 | TENANT_HOST_PATTERN: "^(.*)-${appname}.${default-domain}" 25 | - name: html5_deployer 26 | type: com.sap.application.content 27 | path: . 28 | requires: 29 | - name: html5-host 30 | parameters: 31 | content-target: true 32 | build-parameters: 33 | build-result: resources 34 | requires: 35 | - artifacts: 36 | - HTML5Module-content.zip 37 | name: HTML5Module 38 | target-path: resources/ 39 | - name: HTML5Module 40 | type: html5 41 | path: HTML5Module 42 | build-parameters: 43 | builder: custom 44 | commands: 45 | - npm run build 46 | supported-platforms: [] 47 | resources: 48 | - name: html5-host 49 | type: org.cloudfoundry.managed-service 50 | parameters: 51 | service: html5-apps-repo 52 | service-plan: app-host 53 | service-name: ${appname}-html5-host 54 | - name: html5-rt 55 | parameters: 56 | service: html5-apps-repo 57 | service-plan: app-runtime 58 | service-name: ${appname}-html5-rt 59 | type: org.cloudfoundry.managed-service 60 | - name: uaa 61 | type: org.cloudfoundry.managed-service 62 | parameters: 63 | service: xsuaa 64 | service-plan: application 65 | service-name: ${appname}-uaa 66 | config: 67 | xsappname: ${appname} 68 | tenant-mode: shared 69 | scopes: 70 | - name: $XSAPPNAME.Read 71 | description: Read permission 72 | - name: $XSAPPNAME.Write 73 | description: Write permission 74 | - name: $XSAPPNAME.Callback 75 | description: With this scope set, the callbacks for tenant onboarding, offboarding and getDependencies can be called. 76 | grant-as-authority-to-apps: 77 | - $XSAPPNAME(application,sap-provisioning,tenant-onboarding) 78 | foreign-scope-references: 79 | - uaa.user 80 | role-templates: 81 | - name: Reader 82 | description: Can read 83 | scope-references: 84 | - $XSAPPNAME.Read 85 | - name: Author 86 | description: Can read and write 87 | scope-references: 88 | - $XSAPPNAME.Read 89 | - $XSAPPNAME.Write 90 | - name: saas-registry 91 | type: org.cloudfoundry.managed-service 92 | parameters: 93 | service: saas-registry 94 | service-plan: application 95 | service-name: ${appname}-saas-registry 96 | config: 97 | xsappname: ${appname} 98 | appName: ${appname} 99 | displayName: Guestbook 100 | description: A guestbook app to explain the concepts of Multitenancy 101 | category: Custom Apps 102 | appUrls: 103 | onSubscription: https://${subdomain}-${appname}.${default-domain}/callback/v1.0/tenants/{tenantId} 104 | getDependencies: https://${subdomain}-${appname}.${default-domain}/callback/v1.0/dependencies 105 | -------------------------------------------------------------------------------- /standalone-mtx-approuter/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mtx-approuter", 3 | "description": "Node.js based application router service for html5-apps", 4 | "dependencies": { 5 | "mbt": "^1.2.7" 6 | }, 7 | "scripts": { 8 | "build": "mbt build" 9 | }, 10 | "version": "1.0.0" 11 | } 12 | -------------------------------------------------------------------------------- /standalone-mtx-approuter/readme.md: -------------------------------------------------------------------------------- 1 | # Multi-tenant Standalone Application Router using HTML5 Application Repository 2 | 3 | ## Diagram 4 | 5 | ![diagram](diagram.png) 6 | 7 | ## Description 8 | The image above shows the guestbook application that you will learn to build in this post. The idea of this guestbook is quite simple; each tenant will have its own guestbook that is available under a unique URL. The application comes with two role templates - reader and author. Readers can see all existing entries of that tenant, and authors can also add new entries. For more details, please refer to this [blog post](https://blogs.sap.com/2021/04/22/cloud-native-lab-4-multi-tenant-apps-in-sap-btp/). 9 | 10 | 11 | To keep things simple, we won't add any persistence layer. We will use a standard JSON object in our extended approuter to temporarily save some data. Consequently, all data is lost once the application restarts, but this is fine for our simple demo. If you would like to persist the data, please look at the [multitenancy guide from CAP](https://cap.cloud.sap/docs/guides/multitenancy). 12 | 13 | 14 | ## Download and Installation 15 | 1. Download the source code: 16 | ``` 17 | git clone https://github.com/SAP-samples/multi-cloud-html5-apps-samples 18 | cd multi-cloud-html5-apps-samples/standalone-mtx-approuter 19 | ``` 20 | 2. Build the project: 21 | ``` 22 | npm install 23 | npm run build 24 | ``` 25 | 3. Deploy the project: 26 | ``` 27 | cf deploy mta_archives/mtx-guestbook_1.0.0.mtar 28 | ``` 29 | 30 | If the deployment has been successful, you find the URL of the application router in the console output or you can print it on Unix-based systems with `cf app mtx-approuter | awk '/^routes/ { print "https://"$2"/" }'`. It probably has the following structure: . 31 | 32 | 33 | ## Configuration 34 | 35 | Before deploying the project, you need to to replace the subdomain placeholders in the `mta.yaml` yaml file. If you want to subscribe multiple tenants from multiple subaccount, add new routes for them as well. For more details, please refer to this [blog post](https://blogs.sap.com/2021/04/22/cloud-native-lab-4-multi-tenant-apps-in-sap-btp/). 36 | 37 | ## Check the Result 38 | 39 | ### List the Deployed HTML5 App 40 | 41 | ``` 42 | $ cf html5-list 43 | Getting list of HTML5 applications in org 9f10ed8atrial / space dev as firstname.lastname@domain.com... 44 | OK 45 | 46 | name version app-host-id service instance visibility last changed 47 | mtxguestbook 1.0.0 78619acc-1181-4c75-a3d9-7ca25ed91790 mtx-guestbook-html5-host public Tue, 20 Apr 2021 14:09:55 GMT 48 | ``` 49 | 50 | ### List the Deployed MTA 51 | 52 | ``` 53 | $ cf mta cf mta mtx-guestbook 54 | Showing health and status for multi-target app cf mta mtx-guestbook in org 9f10ed8atrial / space dev as firstname.lastname@domain.com... 55 | OK 56 | Version: 1.0.0 57 | 58 | Apps: 59 | name requested state instances memory disk urls 60 | mtx-approuter started 1/1 256M 256M -mtx-guestbook.cfapps.eu10.hana.ondemand.com, -mtx-guestbook.cfapps.eu10.hana.ondemand.com 61 | 62 | Services: 63 | name service plan bound apps last operation 64 | mtx-guestbook-html5-host html5-apps-repo app-host create succeeded 65 | mtx-guestbook-html5-rt html5-apps-repo app-runtime mtx-approuter create succeeded 66 | mtx-guestbook-saas-registry saas-registry application mtx-approuter create succeeded 67 | mtx-guestbook-uaa xsuaa application mtx-approuter create succeeded 68 | ``` 69 | 70 | ### Check the Web App 71 | 72 | Access the URL to view the web app. You are directed to a sign-on page before you can see the web app that display your name. 73 | 74 | ![webapp](result.png) 75 | -------------------------------------------------------------------------------- /standalone-mtx-approuter/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-mtx-approuter/result.png -------------------------------------------------------------------------------- /standalone-mtx-approuter/router/extended-server.js: -------------------------------------------------------------------------------- 1 | const approuter = require('@sap/approuter'); 2 | 3 | const ar = approuter(), 4 | entries = {}; 5 | 6 | ar.beforeRequestHandler.use('/guestbook', function myMiddleware(req, res) { 7 | if (req.isUnauthenticated()) { 8 | res.statusCode = 401; 9 | res.end("Unauthorized"); 10 | return; 11 | } 12 | const canRead = req.user.scopes.find((scope => scope.includes("Read"))); 13 | if (!canRead) { 14 | res.statusCode = 401; 15 | res.end("Unauthorized"); 16 | return; 17 | } 18 | const canWrite = req.user.scopes.find((scope => scope.includes("Write"))); 19 | const tenant = req.user.tenant; 20 | if (req.method === "POST" && canWrite) { // not the best permission check but ok for demo 21 | if (!entries[tenant]) { 22 | entries[tenant] = []; 23 | } 24 | entries[tenant].push({ 25 | content: req.query.content, 26 | author: req.user.name, 27 | timestamp: new Date() 28 | }) 29 | } 30 | res.end(JSON.stringify({ 31 | tenant, 32 | canWrite, 33 | user: req.user.name, 34 | entries: entries[tenant] 35 | })); 36 | }); 37 | ar.start(); -------------------------------------------------------------------------------- /standalone-mtx-approuter/router/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "approuter", 3 | "description": "Node.js based application router service for html5-apps", 4 | "dependencies": { 5 | "@sap/approuter": "latest" 6 | }, 7 | "scripts": { 8 | "start": "node extended-server.js" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /standalone-mtx-approuter/router/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/index.html", 3 | "authenticationMethod": "route", 4 | "logout": { 5 | "logoutEndpoint": "/logout", 6 | "logoutPage": "/logout.html" 7 | }, 8 | "routes": [ 9 | { 10 | "source": "^/logout.html$", 11 | "target": "/mtxguestbook/logout.html", 12 | "service": "html5-apps-repo-rt", 13 | "authenticationType": "none" 14 | }, 15 | { 16 | "source": "(.*)", 17 | "scope": ["$XSAPPNAME.Read"], 18 | "target": "/mtxguestbook/$1", 19 | "service": "html5-apps-repo-rt" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/deployer/readme.md: -------------------------------------------------------------------------------- 1 | # Deployer module 2 | 3 | The build process will move the zipped web apps in here. 4 | -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/deployer/resources/uimodule.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-portal-keyuser-mta/deployer/resources/uimodule.zip -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-portal-keyuser-mta/diagram.png -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/launchpad/portal-site/CommonDataModel.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "3.0.0", 3 | "identification": { 4 | "id": "c9aae627-9601-4a11-83c3-41b94a3c8026-1576776549699", 5 | "entityType": "bundle" 6 | }, 7 | "payload": { 8 | "catalogs": [ 9 | { 10 | "_version": "3.0.0", 11 | "identification": { 12 | "id": "defaultCatalogId", 13 | "title": "{{catalogs.title}}", 14 | "entityType": "catalog", 15 | "i18n": "i18n/i18n.properties" 16 | }, 17 | "payload": { 18 | "viz": [ 19 | { 20 | "id": "com.myorg.standaloneportalmta", 21 | "vizId": "uimodule-display" 22 | } 23 | ] 24 | } 25 | } 26 | ], 27 | "groups": [ 28 | { 29 | "_version": "3.0.0", 30 | "identification": { 31 | "id": "defaultGroupId", 32 | "title": "{{groups.title}}", 33 | "entityType": "group", 34 | "i18n": "i18n/i18n.properties" 35 | }, 36 | "payload": { 37 | "viz": [ 38 | { 39 | "id": "com.myorg.standaloneportalmta", 40 | "appId": "com.myorg.standaloneportalmta", 41 | "vizId": "uimodule-display" 42 | } 43 | ] 44 | } 45 | } 46 | ], 47 | "sites": [ 48 | { 49 | "_version": "3.0.0", 50 | "identification": { 51 | "id": "b9ad73bb-384c-4740-b39a-7f0fad5e6acc-1576776549700", 52 | "entityType": "site", 53 | "title": "SAP Fiori launchpad site on Cloud Foundry", 54 | "description": "" 55 | }, 56 | "payload": { 57 | "config": { 58 | "ushellConfig": { 59 | "bootstrapPlugins": { 60 | "KeyUserPlugin": { 61 | "component": "sap.ushell.plugins.rta" 62 | }, 63 | "PersonalizePlugin": { 64 | "component": "sap.ushell.plugins.rta-personalize" 65 | } 66 | }, 67 | "renderers": { 68 | "fiori2": { 69 | "componentData": { 70 | "config": { 71 | "applications": { 72 | "Shell-home": {} 73 | } 74 | } 75 | } 76 | } 77 | } 78 | } 79 | }, 80 | "groupsOrder": [ 81 | "defaultGroupId" 82 | ], 83 | "sap.cloud.portal": { 84 | "config": { 85 | "flexibilityServices": [ 86 | { 87 | "connector": "KeyUserConnector", 88 | "url": "/keyuser" 89 | } 90 | ], 91 | "theme.id": "sap_fiori_3", 92 | "theme.active": [ 93 | "sap_fiori_3", 94 | "sap_fiori_3_dark", 95 | "sap_belize", 96 | "sap_belize_hcb", 97 | "sap_belize_hcw" 98 | ] 99 | } 100 | } 101 | } 102 | } 103 | ] 104 | } 105 | } -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/launchpad/portal-site/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | #XTIT 2 | catalogs.title=Catalog Title 3 | #XTIT 4 | groups.title=Group Title 5 | -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/mta.yaml: -------------------------------------------------------------------------------- 1 | ID: standalone-portal-keyuser-mta 2 | _schema-version: 3.2.0 3 | version: 1.0.0 4 | parameters: 5 | enable-parallel-deployments: true 6 | modules: 7 | - name: standaloneportalmta 8 | type: nodejs 9 | path: router 10 | parameters: 11 | disk-quota: 512M 12 | memory: 512M 13 | requires: 14 | - name: standaloneportalmta_destination 15 | - name: standaloneportalmta_html5_repo_runtime 16 | - name: standaloneportalmta_uaa 17 | - name: standaloneportalmta_portal 18 | - name: standaloneportalmta_keyuser 19 | - name: webapp_deployer 20 | type: com.sap.application.content 21 | path: deployer 22 | requires: 23 | - name: standaloneportalmta_html5_repo_host 24 | parameters: 25 | content-target: true 26 | build-parameters: 27 | build-result: resources 28 | - name: standaloneportalmta_launchpad_deployer 29 | type: com.sap.application.content 30 | path: launchpad 31 | deployed-after: 32 | - standaloneportalmta_deployer 33 | requires: 34 | - name: standaloneportalmta_html5_repo_host 35 | - name: standaloneportalmta_uaa 36 | - name: standaloneportalmta_portal 37 | parameters: 38 | content-target: true 39 | service-key: 40 | name: content-deploy-key 41 | config: 42 | content-endpoint: developer 43 | resources: 44 | - name: standaloneportalmta_destination 45 | type: org.cloudfoundry.managed-service 46 | parameters: 47 | service-plan: lite 48 | service: destination 49 | - name: standaloneportalmta_html5_repo_host 50 | type: org.cloudfoundry.managed-service 51 | parameters: 52 | service-plan: app-host 53 | service: html5-apps-repo 54 | config: 55 | sizeLimit: 2 56 | - name: standaloneportalmta_html5_repo_runtime 57 | type: org.cloudfoundry.managed-service 58 | parameters: 59 | service-plan: app-runtime 60 | service: html5-apps-repo 61 | - name: standaloneportalmta_uaa 62 | type: org.cloudfoundry.managed-service 63 | parameters: 64 | path: ./xs-security.json 65 | service-plan: application 66 | service: xsuaa 67 | - name: standaloneportalmta_portal 68 | type: org.cloudfoundry.managed-service 69 | parameters: 70 | service-plan: standard 71 | service: portal 72 | - name: standaloneportalmta_keyuser 73 | parameters: 74 | service-plan: free #or 'keyuser' 75 | service: ui5-flexibility-keyuser 76 | type: org.cloudfoundry.managed-service 77 | -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "standalone-portal-mta", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "build": "mbt build", 6 | "deploy:cf": "cross-var cf deploy mta_archives/standalone-portal-mta_$npm_package_version.mtar", 7 | "deploy": "run-s build deploy:cf" 8 | }, 9 | "devDependencies": { 10 | "npm-run-all": "^4.1.5", 11 | "cross-var": "^1.1.0", 12 | "mbt": "^1.1.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/readme.md: -------------------------------------------------------------------------------- 1 | # Standalone Application Router with full Launchpad Integration 2 | 3 | ## Diagram 4 | 5 | ![diagram](diagram.png) 6 | 7 | ## Description 8 | 9 | > Note: The service plan "portal-standard" [has been removed from the trial landscape](https://blogs.sap.com/2019/07/22/portal-service-available-on-sap-cloud-platform-cloud-foundry-trial-account/) and therefore this sample cannot be deployed to trial environments any longer. Please use a [free tier](https://developers.sap.com/group.btp-setup.html) or production environment as the target platform. 10 | 11 | This is an example of an HTML5 app that you maintain on a standalone application router in your own space in the Cloud Foundry environment. The app is deployed to the HTML Application Repository. The app uses the Authentication & Authorization service (XSUAA service) and the destination service. The app is integrated into the SAP Cloud Portal service, which enables the app to be started from an SAP Fiori Launchpad. This example also includes an integration with the UI5 Flexibility Service for Key Users, which enables a key users to make UI changes. 12 | 13 | 14 | ## Download and Installation 15 | 1. Download the source code: 16 | ``` 17 | git clone https://github.com/SAP-samples/multi-cloud-html5-apps-samples 18 | cd multi-cloud-html5-apps-samples/standalone-approuter-portal-keyuser-mta 19 | ``` 20 | 2. Build the project: 21 | ``` 22 | npm install 23 | npm run build 24 | ``` 25 | 3. Deploy the project: 26 | ``` 27 | cf deploy mta_archives/standalone-portal-keyuser-mta_1.0.0.mtar 28 | ``` 29 | 30 | If the deployment has been successful, you find the URL of the application router in the console output or you can print it on Unix-based systems with `cf app standaloneportalmta | awk '/^routes/ { print "https://"$2"/" }'`. It probably has the following structure: . 31 | 32 | 33 | 34 | 35 | ## Configuration 36 | 37 | The `deployer/resources/uimodule.zip` archive contains a sample SAPUI5 web app and is already prepacked, so that it can easily be deployed. 38 | 39 | You can replace the content of the archieve with your web app but keep in mind that you also need to change the path to the default app if the new web app has a different ID. This app ID also needs to be referenced in the `launchpad/portal-site/CommonDataModel.json` file. In case you want to know what happens in this sample, check out [this blog post](https://blogs.sap.com/2020/06/22/understanding-the-nuts-and-bolts-of-sap-fiori-development-for-cloud-foundry/). 40 | 41 | To change the path to the default app, edit the `welcomeFile` property in the [`xs-app.json`](router/xs-app.json) configuration file of the application router. 42 | 43 | ## Check the Result 44 | 45 | ### List the Deployed HTML5 App 46 | ``` 47 | $ cf html5-list 48 | Getting list of HTML5 applications in org [cf-org-name] / space dev as firstname.lastname@domain.com... 49 | OK 50 | 51 | name version app-host-id service instance visibility last changed 52 | commyorgstandaloneportalmta 1.0.0 f97283a5-3f63-4398-af40-fe8220e0055b standaloneportalmta_html5_repo_host private Mon, 10 Aug 2020 13:54:57 GMT 53 | ``` 54 | 55 | ### List the Deployed MTA 56 | 57 | ``` 58 | $ cf mta standalone-portal-keyuser-mta 59 | Showing health and status for multi-target app standalone-portal-keyuser-mta in org [cf-org-name] / space dev as firstname.lastname@domain.com... 60 | OK 61 | Version: 1.0.0 62 | 63 | Apps: 64 | name requested state instances memory disk urls 65 | standaloneportalmta_launchpad_deployer stopped 0/1 256M 1G 66 | standaloneportalmta started 1/1 512M 512M [cf-org-name]-dev-standaloneportalmta.cfapps.us10.hana.ondemand.com 67 | 68 | Services: 69 | name service plan bound apps last operation 70 | standaloneportalmta_destination destination lite standaloneportalmta create succeeded 71 | standaloneportalmta_html5_repo_host html5-apps-repo app-host standaloneportalmta_launchpad_deployer create succeeded 72 | standaloneportalmta_html5_repo_runtime html5-apps-repo app-runtime standaloneportalmta create succeeded 73 | standaloneportalmta_keyuser ui5-flexibility-keyuser keyuser standaloneportalmta create succeeded 74 | standaloneportalmta_portal portal standard standaloneportalmta_launchpad_deployer, standaloneportalmta create succeeded 75 | standaloneportalmta_uaa xsuaa application standaloneportalmta_launchpad_deployer, standaloneportalmta create succeeded 76 | ``` 77 | 78 | ### Check the Web App 79 | 80 | Access the URL to view the web app. You are redirected to a sign-on page before you can see the web app. 81 | 82 | > In order to be able to see the **Adapt UI** button and make UI changes you have to enter the BTP cockpit, create a role collection that contains the role `FlexKeyUser`, and assign it to your account. 83 | 84 | 85 | ![webapp1](result1.png) 86 | ![webapp2](result2.png) 87 | -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/result1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-portal-keyuser-mta/result1.png -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/result2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-portal-keyuser-mta/result2.png -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/router/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "appouter", 3 | "description": "Node.js based application router service for html5-apps", 4 | "dependencies": { 5 | "@sap/approuter": "latest" 6 | }, 7 | "scripts": { 8 | "start": "node node_modules/@sap/approuter/approuter.js" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/router/readme.md: -------------------------------------------------------------------------------- 1 | # standaloneportalmta 2 | 3 | contains a sample SAPUI5 web app and all needed services 4 | 5 | In case you want to know what happens in this sample, check out [this blog post](https://blogs.sap.com/2020/06/22/understanding-the-nuts-and-bolts-of-sap-fiori-development-for-cloud-foundry/). 6 | 7 | Explain what is in zip folder, how it is linked to commondatamodel 8 | 9 | 10 | ## Credits 11 | This project has been generated with 💙 and [easy-ui5](https://github.com/SAP) 12 | -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/router/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/cp.portal", 3 | "authenticationMethod": "none", 4 | "logout": { 5 | "logoutEndpoint": "/do/logout" 6 | }, 7 | "routes": [ 8 | { 9 | "source": "^/keyuser/(.*)$", 10 | "target": "$1", 11 | "service": "com.sap.ui.flex.cf.keyuser", 12 | "endpoint": "keyuser" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /standalone-portal-keyuser-mta/xs-security.json: -------------------------------------------------------------------------------- 1 | { 2 | "xsappname": "standaloneportalmta", 3 | "tenant-mode": "dedicated", 4 | "description": "Security profile of called application", 5 | "scopes": [ 6 | { 7 | "name": "uaa.user", 8 | "description": "UAA" 9 | } 10 | ], 11 | "role-templates": [ 12 | { 13 | "name": "Token_Exchange", 14 | "description": "UAA", 15 | "scope-references": [ 16 | "uaa.user" 17 | ] 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /standalone-portal-mta/deployer/readme.md: -------------------------------------------------------------------------------- 1 | # Deployer module 2 | 3 | The build process will move the zipped web apps in here. 4 | -------------------------------------------------------------------------------- /standalone-portal-mta/deployer/resources/uimodule.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-portal-mta/deployer/resources/uimodule.zip -------------------------------------------------------------------------------- /standalone-portal-mta/diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-portal-mta/diagram.png -------------------------------------------------------------------------------- /standalone-portal-mta/launchpad/portal-site/CommonDataModel.json: -------------------------------------------------------------------------------- 1 | { 2 | "_version": "3.0.0", 3 | "identification": { 4 | "id": "c9aae627-9601-4a11-83c3-41b94a3c8026-1576776549699", 5 | "entityType": "bundle" 6 | }, 7 | "payload": { 8 | "catalogs": [ 9 | { 10 | "_version": "3.0.0", 11 | "identification": { 12 | "id": "defaultCatalogId", 13 | "title": "{{catalogs.title}}", 14 | "entityType": "catalog", 15 | "i18n": "i18n/i18n.properties" 16 | }, 17 | "payload": { 18 | "viz": [ 19 | { 20 | "id": "com.myorg.standaloneportalmta", 21 | "vizId": "uimodule-display" 22 | } 23 | ] 24 | } 25 | } 26 | ], 27 | "groups": [ 28 | { 29 | "_version": "3.0.0", 30 | "identification": { 31 | "id": "defaultGroupId", 32 | "title": "{{groups.title}}", 33 | "entityType": "group", 34 | "i18n": "i18n/i18n.properties" 35 | }, 36 | "payload": { 37 | "viz": [ 38 | { 39 | "id": "com.myorg.standaloneportalmta", 40 | "appId": "com.myorg.standaloneportalmta", 41 | "vizId": "uimodule-display" 42 | } 43 | ] 44 | } 45 | } 46 | ], 47 | "sites": [ 48 | { 49 | "_version": "3.0.0", 50 | "identification": { 51 | "id": "b9ad73bb-384c-4740-b39a-7f0fad5e6acc-1576776549700", 52 | "entityType": "site", 53 | "title": "SAP Fiori launchpad site on Cloud Foundry", 54 | "description": "" 55 | }, 56 | "payload": { 57 | "config": { 58 | "ushellConfig": { 59 | "bootstrapPlugins": { 60 | "PersonalizePlugin": { 61 | "component": "sap.ushell.plugins.rta-personalize" 62 | } 63 | }, 64 | "renderers": { 65 | "fiori2": { 66 | "componentData": { 67 | "config": { 68 | "applications": { 69 | "Shell-home": {} 70 | } 71 | } 72 | } 73 | } 74 | } 75 | } 76 | }, 77 | "groupsOrder": [ 78 | "defaultGroupId" 79 | ], 80 | "sap.cloud.portal": { 81 | "config": { 82 | "theme.id": "sap_fiori_3", 83 | "theme.active": [ 84 | "sap_fiori_3", 85 | "sap_fiori_3_dark", 86 | "sap_belize", 87 | "sap_belize_hcb", 88 | "sap_belize_hcw" 89 | ] 90 | } 91 | } 92 | } 93 | } 94 | ] 95 | } 96 | } -------------------------------------------------------------------------------- /standalone-portal-mta/launchpad/portal-site/i18n/i18n.properties: -------------------------------------------------------------------------------- 1 | #XTIT 2 | catalogs.title=Catalog Title 3 | #XTIT 4 | groups.title=Group Title 5 | -------------------------------------------------------------------------------- /standalone-portal-mta/mta.yaml: -------------------------------------------------------------------------------- 1 | ID: standalone-portal-mta 2 | _schema-version: 3.2.0 3 | version: 1.0.0 4 | parameters: 5 | enable-parallel-deployments: true 6 | modules: 7 | - name: standaloneportalmta 8 | type: nodejs 9 | path: router 10 | parameters: 11 | disk-quota: 512M 12 | memory: 512M 13 | requires: 14 | - name: standaloneportalmta_destination 15 | - name: standaloneportalmta_html5_repo_runtime 16 | - name: standaloneportalmta_uaa 17 | - name: standaloneportalmta_portal 18 | - name: webapp_deployer 19 | type: com.sap.application.content 20 | path: deployer 21 | requires: 22 | - name: standaloneportalmta_html5_repo_host 23 | parameters: 24 | content-target: true 25 | build-parameters: 26 | build-result: resources 27 | - name: standaloneportalmta_launchpad_deployer 28 | type: com.sap.application.content 29 | path: launchpad 30 | deployed-after: 31 | - standaloneportalmta_deployer 32 | requires: 33 | - name: standaloneportalmta_html5_repo_host 34 | - name: standaloneportalmta_uaa 35 | - name: standaloneportalmta_portal 36 | parameters: 37 | content-target: true 38 | service-key: 39 | name: content-deploy-key 40 | config: 41 | content-endpoint: developer 42 | resources: 43 | - name: standaloneportalmta_destination 44 | type: org.cloudfoundry.managed-service 45 | parameters: 46 | service-plan: lite 47 | service: destination 48 | - name: standaloneportalmta_html5_repo_host 49 | type: org.cloudfoundry.managed-service 50 | parameters: 51 | service-plan: app-host 52 | service: html5-apps-repo 53 | config: 54 | sizeLimit: 2 55 | - name: standaloneportalmta_html5_repo_runtime 56 | type: org.cloudfoundry.managed-service 57 | parameters: 58 | service-plan: app-runtime 59 | service: html5-apps-repo 60 | - name: standaloneportalmta_uaa 61 | type: org.cloudfoundry.managed-service 62 | parameters: 63 | path: ./xs-security.json 64 | service-plan: application 65 | service: xsuaa 66 | - name: standaloneportalmta_portal 67 | type: org.cloudfoundry.managed-service 68 | parameters: 69 | service-plan: standard 70 | service: portal 71 | -------------------------------------------------------------------------------- /standalone-portal-mta/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "standalone-portal-mta", 3 | "version": "0.0.1", 4 | "scripts": { 5 | "build": "mbt build", 6 | "deploy:cf": "cross-var cf deploy mta_archives/standalone-portal-mta_$npm_package_version.mtar", 7 | "deploy": "run-s build deploy:cf" 8 | }, 9 | "devDependencies": { 10 | "npm-run-all": "^4.1.5", 11 | "cross-var": "^1.1.0", 12 | "mbt": "^1.1.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /standalone-portal-mta/readme.md: -------------------------------------------------------------------------------- 1 | # On Standalone Application Router, with SAP Cloud Portal Integration 2 | 3 | ## Diagram 4 | 5 | ![diagram](diagram.png) 6 | 7 | ## Description 8 | 9 | > Note: The service plan "portal-standard" [has been removed from the trial landscape](https://blogs.sap.com/2019/07/22/portal-service-available-on-sap-cloud-platform-cloud-foundry-trial-account/) and therefore this sample cannot be deployed to trial environments any longer. Please use a [free tier](https://developers.sap.com/group.btp-setup.html) or production environment as the target platform or explore the [SAP Fiori app with a managed application router](../managed-html5-runtime-fiori-mta). 10 | 11 | This is an example of an HTML5 app that you maintain on a standalone application router in your own space in the Cloud Foundry environment. The app is deployed to the HTML Application Repository. The app uses Authentication & Authorization service (XSUAA service), the destination service and the SAP Cloud Portal service, which means that the app can be integrated in an SAP Fiori Launchpad. 12 | 13 | 14 | ## Download and Installation 15 | 1. Download the source code: 16 | ``` 17 | git clone https://github.com/SAP-samples/multi-cloud-html5-apps-samples 18 | cd multi-cloud-html5-apps-samples/standalone-approuter-portal-mta 19 | ``` 20 | 2. Build the project: 21 | ``` 22 | npm install 23 | npm run build 24 | ``` 25 | 3. Deploy the project: 26 | ``` 27 | cf deploy mta_archives/standalone-portal-mta_1.0.0.mtar 28 | ``` 29 | 30 | If the deployment has been successful, you find the URL of the application router in the console output or you can print it on Unix-based systems with `cf app standaloneportalmta | awk '/^routes/ { print "https://"$2"/" }'`.It probably has the following structure: . 31 | 32 | 33 | ## Configuration 34 | 35 | The `deployer/resources/uimodule.zip` archive contains a sample SAPUI5 web app and is already prepacked, so that it can easily be deployed. 36 | 37 | You can replace the content of the archive with your own web app but keep in mind that you have to change the path to the default app if the web app has a different ID. This app ID also needs to be referenced in the `launchpad/portal-site/CommonDataModel.json` file. In case you want to know what happens in this sample, check out [this blog post](https://blogs.sap.com/2020/06/22/understanding-the-nuts-and-bolts-of-sap-fiori-development-for-cloud-foundry/). 38 | 39 | To change the path to the default app, edit the `welcomeFile` property in the [`xs-app.json`](router/xs-app.json) configuration file of the application router. 40 | 41 | ## Check the Result 42 | 43 | ### List the Deployed HTML5 Apps 44 | ``` 45 | $ cf html5-list 46 | Getting list of HTML5 applications in org 9f10ed8atrial / space dev as firstname.lastname@domain.com... 47 | OK 48 | 49 | name version app-host-id service instance visibility last changed 50 | commyorgstandaloneportalmta 1.0.0 f97283a5-3f63-4398-af40-fe8220e0055b standaloneportalmta_html5_repo_host private Mon, 10 Aug 2020 13:54:57 GMT 51 | ``` 52 | 53 | ### List the Deployed MTA 54 | 55 | ``` 56 | $ cf mta standalone-portal-mta 57 | Showing health and status for multi-target app standalone-portal-mta in org 9f10ed8atrial / space dev as firstname.lastname@domain.com... 58 | OK 59 | Version: 1.0.0 60 | 61 | 62 | Apps: 63 | name requested state instances memory disk urls 64 | standaloneportalmta_launchpad_deployer stopped 0/1 256M 1G 65 | standaloneportalmta started 1/1 512M 512M 9f10ed8atrial-dev-standaloneportalmta.cfapps.us10.hana.ondemand.com 66 | 67 | Services: 68 | name service plan bound apps last operation 69 | standaloneportalmta_destination destination lite standaloneportalmta create succeeded 70 | standaloneportalmta_html5_repo_host html5-apps-repo app-host standaloneportalmta_launchpad_deployer create succeeded 71 | standaloneportalmta_html5_repo_runtime html5-apps-repo app-runtime standaloneportalmta create succeeded 72 | standaloneportalmta_portal portal standard standaloneportalmta_launchpad_deployer, standaloneportalmta create succeeded 73 | standaloneportalmta_uaa xsuaa application standaloneportalmta_launchpad_deployer, standaloneportalmta create succeeded 74 | ``` 75 | 76 | ### Check the Web App 77 | 78 | Access the URL to view the web app. You are redirected to a sign-on page before you can see the web app. 79 | 80 | ![webapp](result.png) 81 | -------------------------------------------------------------------------------- /standalone-portal-mta/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SAP-samples/multi-cloud-html5-apps-samples/c72d1c27c1babc4da590547930e2355444303e41/standalone-portal-mta/result.png -------------------------------------------------------------------------------- /standalone-portal-mta/router/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "appouter", 3 | "description": "Node.js based application router service for html5-apps", 4 | "dependencies": { 5 | "@sap/approuter": "latest" 6 | }, 7 | "scripts": { 8 | "start": "node node_modules/@sap/approuter/approuter.js" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /standalone-portal-mta/router/xs-app.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcomeFile": "/cp.portal", 3 | "authenticationMethod": "none", 4 | "logout": { 5 | "logoutEndpoint": "/do/logout" 6 | }, 7 | "routes": [] 8 | } 9 | -------------------------------------------------------------------------------- /standalone-portal-mta/xs-security.json: -------------------------------------------------------------------------------- 1 | { 2 | "xsappname": "standaloneportalmta", 3 | "tenant-mode": "dedicated", 4 | "description": "Security profile of called application", 5 | "scopes": [ 6 | { 7 | "name": "uaa.user", 8 | "description": "UAA" 9 | } 10 | ], 11 | "role-templates": [ 12 | { 13 | "name": "Token_Exchange", 14 | "description": "UAA", 15 | "scope-references": [ 16 | "uaa.user" 17 | ] 18 | } 19 | ] 20 | } --------------------------------------------------------------------------------