Skip to content

Commit a8e32b2

Browse files
committed
simplify code
1 parent a7c0e0f commit a8e32b2

File tree

12 files changed

+53
-56
lines changed

12 files changed

+53
-56
lines changed

managed-html5-runtime-jwt-kyma/backend/server.js renamed to managed-html5-runtime-jwt-kyma/backend/backend.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ app.get("/", function (_, res) {
99
res.end("This app runs on SAP BTP, Kyma Runtime. \n Yay! 🚀");
1010
});
1111

12-
app.get("/be", function (req, res) {
12+
app.get("/token", function (req, res) {
1313
console.log("====Req headers ", req.headers);
1414
let token = req.headers["authorization"];
1515
if (!token) {
@@ -21,5 +21,5 @@ app.get("/be", function (req, res) {
2121
res.end(JSON.stringify(decodedToken));
2222
});
2323

24-
app.listen(process.env.PORT || 3000);
24+
app.listen(process.env.PORT || 5000);
2525

Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
2-
"name": "backend",
3-
"version": "1.0.0",
4-
"main": "server.js",
5-
"scripts": {
6-
"start": "node server.js"
7-
},
8-
"dependencies": {
9-
"express": "^4.17.1",
10-
"jwt-decode": "3.1.2"
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+
}
1112
}
12-
}
13+

managed-html5-runtime-jwt-kyma/html5-app-deployer/Dockerfile renamed to managed-html5-runtime-jwt-kyma/deployer/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ WORKDIR /app
1010
COPY . .
1111
RUN npm install --production
1212

13+
EXPOSE 5000
1314
CMD [ "npm", "start" ]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "kyma-html5-app-deployer",
3+
"version": "1.0.0",
4+
"dependencies": {
5+
"@sap/html5-app-deployer": "2.3.1"
6+
},
7+
"scripts": {
8+
"start": "node node_modules/@sap/html5-app-deployer/index.js"
9+
}
10+
}
11+

managed-html5-runtime-jwt-kyma/html5-app-deployer/resources/ui5-app/index.html renamed to managed-html5-runtime-jwt-kyma/deployer/resources/webapp/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
jQuery.ajax({
4242
type: "GET",
4343
contentType: "application/json",
44-
url: "be",
44+
url: "token",
4545
success: function (data, textStatus, jqXHR) {
4646
sap.m.MessageBox.show(JSON.stringify(data, null, 4), { title: "Success - UAA Token" });
4747
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ spec:
104104
\"Description\":\"my kyma backend\",
105105
\"Type\":\"HTTP\",
106106
\"ProxyType\":\"Internet\",
107-
\"URL\":\"https://backend.c210ab1.kyma.shoot.live.k8s-hana.ondemand.com\",
107+
\"URL\":\"https://backend.c-13093b0.kyma.shoot.live.k8s-hana.ondemand.com\",
108108
\"Authentication\":\"NoAuthentication\",
109109
\"HTML5.forwardAuthToken\": true}]"
110110
volumes:

managed-html5-runtime-jwt-kyma/html5-app-deployer/package.json

-10
This file was deleted.

managed-html5-runtime-jwt-kyma/html5-app-deployer/resources/ui5-app/xs-app.json

-32
This file was deleted.

0 commit comments

Comments
 (0)