Files
shields/services/discourse/discourse-redirect.service.js
2021-07-09 12:53:55 +01:00

17 lines
426 B
JavaScript

import { redirector } from '../index.js'
export default [
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'),
}),
]