UNPKG

hiproxy

Version:

hiproxy - lightweight and powerful proxy tool for front-end developer based on Node.js.

22 lines (18 loc) 374 B
/** * @file hiproxy system router * @author zdying */ 'use strict'; var routers = require('../../routers'); module.exports = function (ctx, next) { var req = ctx.req; var res = ctx.res; var url = req.url.split('?')[0]; var render = routers.getRender(url); var hiproxy = this; if (render) { render.call(hiproxy, req, res); } else { next(); } };