# http-mock **Repository Path**: zhangxiao_coder/http-mock ## Basic Information - **Project Name**: http-mock - **Description**: http模拟服务 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-13 - **Last Updated**: 2024-12-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: Nodejs ## README # Http Mock HTTP模拟服务,根据请求的URL加载对应路径下的文件模块,将相关数据返回给客户端。 ## 模拟数据示例 ```js exports.getData = function (method) { let res = { retCode: "00", retMsg: "默认返回结果" }; return JSON.stringify(res); }; ``` 这里采用 `exports.getData()` 的形式导出数据,因为有些数据需要根据实际情况动态生成。 --- ## 注意 1. 本地需要有Node环境。