Files
shields/services/discourse/discourse-redirect.service.js
Caleb Cartwright 51d864efc1 move [Discourse] url to query param (#4020)
* refactor: switch Discourse url to query param

* tests: fix e2e test with Discourse example

* refactor(Discourse): change query param name to server

* tests: update e2e test with new discourse param name
2019-09-16 02:15:19 +00:00

19 lines
438 B
JavaScript

'use strict'
const { redirector } = require('..')
module.exports = [
redirector({
category: 'chat',
route: {
base: 'discourse',
pattern: ':protocol(http|https)/:hostAndPath(.+)/:metric',
},
transformPath: ({ metric }) => `/discourse/${metric}`,
transformQueryParams: ({ protocol, hostAndPath }) => ({
server: `${protocol}://${hostAndPath}`,
}),
dateAdded: new Date('2019-09-15'),
}),
]