Skip to content

Instantly share code, notes, and snippets.

@ArnaudBuchholz
Created April 6, 2020 13:31
Show Gist options
  • Save ArnaudBuchholz/2300cb9b81d4c99525a6722c83bd0fa9 to your computer and use it in GitHub Desktop.
Save ArnaudBuchholz/2300cb9b81d4c99525a6722c83bd0fa9 to your computer and use it in GitHub Desktop.
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()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment