1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-09-19 18:57:30 +00:00
cloudtube/api/redirects.js

11 lines
311 B
JavaScript
Raw Normal View History

2021-02-03 07:49:21 +00:00
const constants = require("../utils/constants")
const {redirect} = require("pinski/plugins")
module.exports = [
{
route: `/(${constants.regex.video_id})`, priority: -1, methods: ["GET"], code: async ({fill, url}) => {
return redirect(`/watch?v=${fill[0]}${url.search.replace(/^\?/, "&")}`, 301)
2021-02-03 07:49:21 +00:00
}
}
]