Skip to content

Commit

Permalink
fix: set port to running options
Browse files Browse the repository at this point in the history
  • Loading branch information
cylon3035 committed Feb 25, 2025
1 parent 0ac26db commit 882d98c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/runtime-node/src/node-env-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,18 @@ export class NodeEnvManager implements IDisposable {
private configMapping: ConfigurationEnvironmentMapping,
private loadModules: (modulePaths: string[]) => Promise<unknown> = importModules,
) {}
public async autoLaunch(runtimeOptions = parseRuntimeOptions(), serverOptions: ILaunchHttpServerOptions = {}) {
public async autoLaunch(
runtimeOptions: Map<string, string | boolean | undefined>,
serverOptions: ILaunchHttpServerOptions = {},
) {
process.env.ENGINE_FLOW_V2_DIST_URL = this.importMeta.url;
const disposeMetricsListener = bindMetricsListener(() => this.collectMetricsFromAllOpenEnvironments());
const verbose = Boolean(runtimeOptions.get('verbose'));
const topLevelConfigInject = parseInjectRuntimeConfigConfig(runtimeOptions);

const staticDirPath = fileURLToPath(new URL('../web', this.importMeta.url));
const { port, socketServer, app, close } = await launchEngineHttpServer({ staticDirPath, ...serverOptions });

runtimeOptions.set('devServerPort', port.toString());
app.get<[string]>('/configs/*', (req, res) => {
const reqEnv = req.query.env as string;
if (typeof reqEnv !== 'string') {
Expand Down

0 comments on commit 882d98c

Please sign in to comment.