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.
- package/index.js +10 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// index.js
|
|
2
|
+
module.exports = (req, res, next) => {
|
|
3
|
+
// 主拦截逻辑
|
|
4
|
+
next();
|
|
5
|
+
};
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
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