Skip to content

Commit aafb49c

Browse files
committed
✨ feat(dapr): choose sidecar by DAPR_HOST
Signed-off-by: Haili Zhang <haili.zhang@outlook.com>
1 parent 5bdf64a commit aafb49c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/openfunction/async_server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function (
2020
context: OpenFunctionContext
2121
): AsyncFunctionServer {
2222
// Initailize Dapr server
23-
const app = new DaprServer('localhost', context.port);
23+
const app = new DaprServer('127.0.0.1', context.port, process.env.DAPR_HOST);
2424

2525
// Create wrapper for user function
2626
const wrapper = OpenFunctionRuntime.WrapUserFunction(userFunction, context);

src/openfunction/runtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ class DaprRuntime extends OpenFunctionRuntime {
206206
* TODO: Should determine whether to use GRPC channel
207207
*/
208208
this.daprClient = new DaprClient(
209-
undefined,
209+
process.env.DAPR_HOST,
210210
this.sidecarPort.HTTP,
211211
CommunicationProtocolEnum.HTTP
212212
);

0 commit comments

Comments
 (0)