* 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
19 lines
438 B
JavaScript
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'),
|
|
}),
|
|
]
|