Skip to content

Instantly share code, notes, and snippets.

View ArnaudBuchholz's full-sized avatar
🏠
Working from home

Arnaud Buchholz ArnaudBuchholz

🏠
Working from home
View GitHub Profile
{
"mappings": [{
"match": "^/proxy/(https?)/(.*)",
"url": "$1://$2",
"unsecure-cookies": true
}, {
"match": "^/echo/(.*)$",
"custom": "./echo.js"
}, {
"match": "^/chrome/(.*)$",
module.exports = async function (request, response, ui5Path) {
const { referer } = request.headers
const version = (/\bversion\b=(\d+\.\d+\.\d+)/.exec(referer) || [0, '1.76.0'])[1]
response.writeHead(302, {
Location: `/@openui5/${version}/${ui5Path}`
})
response.end()
}
{
"port": 8080,
"mappings": [{
"match": "/@openui5/([^/]*)/(.*)",
"url": "https://openui5.hana.ondemand.com/$1/resources/$2"
}, {
"match": "/resources/(.*)",
"custom": "./proxy-version.js"
}, {
"custom": "./csp.js"
{
"port": 8080,
"mappings": [{
"match": "/resources/(.*)",
"url": "https://openui5.hana.ondemand.com/1.76.0/resources/$1"
}, {
"custom": "./csp.js"
}, {
"match": "^/(\\?.*)?$",
"file": "./webapp/index.html"
module.exports = async function (request, response) {
response.setHeader('Content-Security-Policy', 'default-src \'self\'')
}
{
"port": 8080,
"mappings": [{
"match": "/resources/(.*)",
"headers": {
"Location": "https://openui5.hana.ondemand.com/1.76.0/resources/$1"
},
"status": 302
}, {
"custom": "./csp.js"
module.exports = async function (request, response, ui5Path) {
const { referer } = request.headers
const version = (/\bversion\b=(\d+\.\d+\.\d+)/.exec(referer) || [0, '1.76.0'])[1]
response.writeHead(302, {
Location: `https://openui5.hana.ondemand.com/${version}/resources/${ui5Path}`
})
response.end()
}
{
"port": 8080,
"mappings": [{
"match": "/resources/(.*)",
"custom": "./redirect-version.js"
}, {
"match": "^/(\\?.*)?$",
"file": "./webapp/index.html"
}, {
"match": "^/(.*)",
{
"port": 8080,
"mappings": [{
"match": "/resources/(.*)",
"headers": {
"Location": "https://openui5.hana.ondemand.com/1.76.0/resources/$1"
},
"status": 302
}, {
"match": "^/(\\?.*)?$",
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>OpenUI5 Demo App</title>
<script id="sap-ui-bootstrap"
src="./resources/sap-ui-core.js"
data-sap-ui-theme="sap_fiori_3"
data-sap-ui-libs="sap.m"
data-sap-ui-resourceroots='{"Demo": "./"}'