Skip to content

Commit

Permalink
πŸ”’ Add post process route to support CloudFlare shield
Browse files Browse the repository at this point in the history
  • Loading branch information
wei committed Jan 1, 2021
1 parent 8babbea commit f85fa68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/router.js
Expand Up @@ -49,7 +49,7 @@ module.exports = app => {
})
})

routes.get('/process/:owner/:repo', (req, res) => {
const processEndpoint = (req, res) => {
const fullName = `${req.params.owner}/${req.params.repo}`
clearConfig(fullName)
app.log.info(`[${fullName}] Processing`)
Expand All @@ -59,7 +59,9 @@ module.exports = app => {
} else {
res.status(404).send('Not found')
}
})
}
routes.get('/process/:owner/:repo', processEndpoint)
routes.post('/process/:owner/:repo', processEndpoint)

routes.get('/check/:owner/:repo', (req, res) => {
const fullName = `${req.params.owner}/${req.params.repo}`
Expand Down

0 comments on commit f85fa68

Please sign in to comment.