Files
shields/services/twitter/twitter-redirect.service.js
Caleb Cartwright db0ebf1e6a move [Twitter] url to query param (#4027)
* 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
2019-09-16 02:07:24 +00:00

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'),
}),
]