Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a port option to gulp server #18339

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2076,8 +2076,19 @@ gulp.task(
console.log();
console.log("### Starting local server");

let port = 8888;
const i = process.argv.indexOf("--port");
if (i >= 0 && i + 1 < process.argv.length) {
const p = parseInt(process.argv[i + 1], 10);
if (!isNaN(p)) {
port = p;
} else {
console.error("Invalid port number: using default (8888)");
}
}

const { WebServer } = await import("./test/webserver.mjs");
const server = new WebServer({ port: 8888 });
const server = new WebServer({ port });
server.start();
}
)
Expand Down