文件名称:express-virtual-request:模拟`request`和`response`对象以对express.js运行虚拟请求
文件大小:4KB
文件格式:ZIP
更新时间:2024-06-13 15:30:07
JavaScript
表达虚拟请求 模拟request和response对象以针对express.js运行虚拟请求 var app = require ( 'express' ) ( ) ; app . get ( '/hello' , function ( req , res ) { res . send ( 'Hello World!' ) } ) ; var VirtualRequest = require ( 'express-virtual-request' ) . request ; var VirtualResponse = require ( 'express-virtual-request' ) . response ; var req = new VirtualRequest ( { method : 'GET' , url : '/users' , headers : {
【文件预览】:
express-virtual-request-master
----index.js(103B)
----package.json(773B)
----LICENSE(1KB)
----lib()
--------request.js(1KB)
--------response.js(2KB)
----README.md(1KB)