Update rewriter

This commit is contained in:
typicode
2016-12-25 07:44:36 +01:00
parent 442746efcc
commit bb64e719b7
2 changed files with 18 additions and 7 deletions

View File

@ -7,6 +7,10 @@ function updateQueryString (target, sourceUrl) {
module.exports = (routes) => {
const router = express.Router()
router.get('/__rules', (req, res) => {
res.json(routes)
})
Object.keys(routes).forEach((route) => {
if (route.indexOf(':') !== -1) {
router.all(route, (req, res, next) => {