Add gitlab proxy route

This commit is contained in:
Yarmo Mackenbach 2021-04-15 23:22:17 +02:00
parent 2299d339a3
commit 954899162e
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1

View file

@ -181,4 +181,24 @@ router.get('/get/irc',
}) })
}) })
// Gitlab route
router.get('/get/gitlab',
query('domain').isFQDN(),
query('username').isString(),
async (req, res) => {
const errors = validationResult(req)
if (!errors.isEmpty()) {
return res.status(400).json({ errors: errors.array() })
}
fetcher
.gitlab.fn(req.query, opts)
.then((data) => {
return res.status(200).send(data)
})
.catch((err) => {
return res.status(400).json({ errors: err.message ? err.message : err })
})
})
module.exports = router module.exports = router