Skip to content

Commit d083803

Browse files
Merge pull request #58 from boyan-velinov/deployment-specific-configuiration
Add MTA deployment specific configuration
2 parents b19b2f2 + 2d9f899 commit d083803

16 files changed

Lines changed: 423 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ For information about how to upload a react-based application to the HTML5 Appli
5656
5757
- [Basic App stored on HTML5 Application Repository, using XSUAA service, and destination service](standalone-approuter-html5-runtime-mta-hello-world)
5858
59+
- [Deployment configurable basic app stored on HTML5 Application Repository, using XSUAA service, and destination service](deployment-configurable-standalone-approuter-html5-runtime-mta-hello-world)
60+
5961
- [Multi-tenant SAP Fiori app on HTML5 Application Repository](standalone-mtx-approuter)
6062
6163
- [SAP Fiori app integrated with SAP Cloud Portal service](standalone-portal-mta)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<html>
2+
<head>
3+
<title>Welcome</title>
4+
<meta charset="UTF-8">
5+
6+
<script>
7+
document.addEventListener("DOMContentLoaded", async () => {
8+
try {
9+
const res = await fetch("/user-api/currentUser");
10+
const user = await res.json();
11+
document.getElementById("greeting").innerText = `Hi ${user.firstname} 👋 in your custom env!`;
12+
} catch (err) {
13+
console.error(err);
14+
document.getElementById("greeting").innerText = `Hi there 👋 in your custom env!`;
15+
}
16+
});
17+
</script>
18+
</head>
19+
20+
<body>
21+
<div id="greeting"></div>
22+
</body>
23+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<html>
2+
<head>
3+
<title>Welcome</title>
4+
<meta charset="UTF-8">
5+
6+
<script>
7+
document.addEventListener("DOMContentLoaded", async () => {
8+
try {
9+
const res = await fetch("/user-api/currentUser");
10+
const user = await res.json();
11+
document.getElementById("greeting").innerText = `Hi ${user.firstname} 👋`;
12+
} catch (err) {
13+
console.error(err);
14+
document.getElementById("greeting").innerText = `Hi there 👋`;
15+
}
16+
});
17+
</script>
18+
</head>
19+
20+
<body>
21+
<div id="greeting"></div>
22+
</body>
23+
</html>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ID: standalone-hello-world-custom
2+
extends: standalone-hello-world
3+
_schema-version: "3.1"
4+
5+
modules:
6+
- name: html5_app_router
7+
properties:
8+
WELCOME_FILE: custom.html
1.48 MB
Loading
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
properties:
13+
WELCOME_FILE: index.html
14+
requires:
15+
- name: html5_repo_runtime
16+
- name: html5_destination
17+
- name: html5_uaa
18+
- name: html5_deployer
19+
type: com.sap.application.content
20+
path: .
21+
requires:
22+
- name: html5_repo_host
23+
parameters:
24+
content-target: true
25+
build-parameters:
26+
build-result: resources
27+
requires:
28+
- artifacts:
29+
- HTML5Module-content.zip
30+
name: HTML5Module
31+
target-path: resources/
32+
- name: HTML5Module
33+
type: html5
34+
path: HTML5Module
35+
build-parameters:
36+
builder: custom
37+
commands:
38+
- npm run build
39+
supported-platforms: []
40+
resources:
41+
- name: html5_repo_host
42+
type: org.cloudfoundry.managed-service
43+
parameters:
44+
service: html5-apps-repo
45+
service-plan: app-host
46+
- name: html5_repo_runtime
47+
parameters:
48+
service-plan: app-runtime
49+
service: html5-apps-repo
50+
type: org.cloudfoundry.managed-service
51+
- name: html5_destination
52+
type: org.cloudfoundry.managed-service
53+
parameters:
54+
service-plan: lite
55+
service: destination
56+
- name: html5_uaa
57+
parameters:
58+
path: ./xs-security.json
59+
service-plan: application
60+
service: xsuaa
61+
type: org.cloudfoundry.managed-service
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
}

0 commit comments

Comments
 (0)