@tuya-sat/micro-dev-proxy 2.2.11 → 2.2.14
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/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,12 +14,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const
|
|
17
|
+
const os_1 = __importDefault(require("os"));
|
|
18
18
|
const http_proxy_middleware_1 = require("http-proxy-middleware");
|
|
19
19
|
const appProxy_1 = __importDefault(require("./appProxy"));
|
|
20
20
|
function createProxy(_a) {
|
|
21
21
|
var { additionHeaders = {} } = _a, restPrevConfig = __rest(_a, ["additionHeaders"]);
|
|
22
|
-
const config = Object.assign({ additionHeaders: Object.assign({ terminalId:
|
|
22
|
+
const config = Object.assign({ additionHeaders: Object.assign({ terminalId: os_1.default.hostname() }, additionHeaders), isMainApp: false, loginApi: "/api/login", needProxyApi: ["/api", "/open-api"], logSign: false, csrf: true }, restPrevConfig);
|
|
23
23
|
const { needProxyApi } = config, appProxyConfig = __rest(config, ["needProxyApi"]);
|
|
24
24
|
const appProxy = new appProxy_1.default(appProxyConfig);
|
|
25
25
|
return function middleware(app) {
|