* refactor(TwitterUrl): move url to query param * refactor(Twitter): update suggestion endpoint * tests: update twitter suggestion int tests * chore: fix typo in suggestion int test
20 lines
442 B
JavaScript
20 lines
442 B
JavaScript
'use strict'
|
|
|
|
const { redirector } = require('..')
|
|
|
|
module.exports = [
|
|
redirector({
|
|
category: 'social',
|
|
name: 'TwitterUrlRedirect',
|
|
route: {
|
|
base: 'twitter/url',
|
|
pattern: ':protocol(https|http)/:hostAndPath+',
|
|
},
|
|
transformPath: () => `/twitter/url`,
|
|
transformQueryParams: ({ protocol, hostAndPath }) => ({
|
|
url: `${protocol}://${hostAndPath}`,
|
|
}),
|
|
dateAdded: new Date('2019-09-17'),
|
|
}),
|
|
]
|