mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2025-01-08 13:59:28 -07:00
Add gitlab proxy route
This commit is contained in:
parent
2299d339a3
commit
954899162e
1 changed files with 20 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue