mirror of
https://github.com/typicode/json-server.git
synced 2025-08-01 09:13:32 +08:00
Update rewriter
This commit is contained in:
@ -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) => {
|
||||
|
Reference in New Issue
Block a user