whistle.pastekitlab 1.3.6 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +10 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,16 +1,19 @@
1
- module.exports = (ctx, options) => {
2
- ctx.addRules({
3
- 'pastekitlab': (req, res, next) => {
4
- console.log('📡 proxy request:', req.fullUrl);
1
+ // index.js
2
+ module.exports = (req, res, next) => {
3
+ // 主拦截逻辑
4
+ next();
5
+ };
5
6
 
6
- // 放行请求
7
- next(); // ✅ 正确!
7
+ // 额外暴露 Web UI(可选)
8
+ module.exports.ui = (server, options) => {
9
+ server.on('request', (req, res) => {
10
+ if (req.url === '/plugin/pastekitlab/config') {
11
+ res.end(JSON.stringify({ status: 'ok' }));
8
12
  }
9
13
  });
10
14
  };
11
15
 
12
16
 
13
-
14
17
  // (server, options) => {
15
18
  // console.log('>>> plugin loaded');
16
19
  // // server.on('request', (req, res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whistle.pastekitlab",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "Whistle plugin for PasteKit Lab - Intercepts requests and sends them to requestlistviewer via WebSocket",
5
5
  "main": "index.js",
6
6
  "scripts": {