@certik/skynet 0.10.37 → 0.10.39
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/CHANGELOG.md +4 -0
- package/api.js +8 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/api.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const osModule = require("os");
|
|
1
2
|
const express = require("express");
|
|
2
3
|
const meow = require("meow");
|
|
3
4
|
const { getJobName, getSelectorFlags, getSelectorDesc } = require("./selector");
|
|
@@ -13,6 +14,12 @@ async function logStartMiddleware(req, res, next) {
|
|
|
13
14
|
next();
|
|
14
15
|
}
|
|
15
16
|
|
|
17
|
+
async function contextMiddleware(req, res, next) {
|
|
18
|
+
res.set("x-instance-id", osModule.hostname());
|
|
19
|
+
|
|
20
|
+
next();
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
async function logEndMiddleware(req, res, next) {
|
|
17
24
|
const start = new Date(res.get("x-requested-at"));
|
|
18
25
|
const end = new Date();
|
|
@@ -134,6 +141,7 @@ ${getSelectorDesc(selector)}
|
|
|
134
141
|
|
|
135
142
|
app[method](
|
|
136
143
|
route.path,
|
|
144
|
+
contextMiddleware,
|
|
137
145
|
logStartMiddleware,
|
|
138
146
|
...middlewares,
|
|
139
147
|
async (req, res, next) => {
|