@worktango/ai-assistant 0.0.41 → 0.0.42
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/express.js +3 -1
- package/express.d.ts +4 -0
- package/package.json +1 -1
package/dist/express.js
CHANGED
|
@@ -11203,7 +11203,8 @@ function setupAiAssistantRoutes(args) {
|
|
|
11203
11203
|
const proxyOptions = {
|
|
11204
11204
|
target: `${protocol}://${args.targetHost}:${port}`,
|
|
11205
11205
|
changeOrigin: true,
|
|
11206
|
-
followRedirects: true,
|
|
11206
|
+
followRedirects: args.followRedirects ?? true,
|
|
11207
|
+
secure: protocol === "https",
|
|
11207
11208
|
pathRewrite: (path, req) => {
|
|
11208
11209
|
const expressRequest = req;
|
|
11209
11210
|
return args.getTargetPath(expressRequest.originalUrl || path);
|
|
@@ -11229,6 +11230,7 @@ function setupAiAssistantRoutes(args) {
|
|
|
11229
11230
|
}
|
|
11230
11231
|
}
|
|
11231
11232
|
};
|
|
11233
|
+
logger.debug("Setting up AI Assistant proxy", proxyOptions);
|
|
11232
11234
|
const proxy = (0, import_http_proxy_middleware.createProxyMiddleware)(proxyOptions);
|
|
11233
11235
|
args.app.use(routePath, ...coalesce(args.preflightMiddlewares, []), proxy);
|
|
11234
11236
|
}
|
package/express.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ export function setupAiAssistantRoutes(args: {
|
|
|
22
22
|
* The protocol of the application to proxy requests to. Defaults to "http".
|
|
23
23
|
*/
|
|
24
24
|
targetProtocol?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to follow redirects. Defaults to true.
|
|
27
|
+
*/
|
|
28
|
+
followRedirects?: boolean;
|
|
25
29
|
/**
|
|
26
30
|
* The route path to the local service's AI assistant. Defaults to
|
|
27
31
|
* "/ai-assistant".
|