添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
非常酷的钥匙扣  ·  ECCV 2024 | ...·  5 月前    · 
朝气蓬勃的绿豆  ·  关于CKS ...·  5 月前    · 
鬼畜的铁链  ·  3DS 验证 | Stripe 文档·  1 年前    · 
聪明的羽毛球  ·  protobuf python解析 ...·  1 年前    · 

express-modify-response

1.0.2 Public • Published

express-modify-response

Example Usage

var expressModifyResponse = require('express-modify-response');
var app = ...
app.use(expressModifyResponse(
    (req, res) => {
        // return true if you want to modify the response later
        if (res.getHeader('Content-Type').startsWith('text/html')) return true;
        return false;
    (req, res, body) => {
        // body is a Buffer with the current response; return Buffer or string with the modified response
        // can also return a Promise.
        return body.toString() + '<script>console.log("hello");</script>';