Skip to content

Commit

Permalink
Merge pull request #18339 from calixteman/add_port_option
Browse files Browse the repository at this point in the history
Add a port option to gulp server
  • Loading branch information
calixteman authored Jun 27, 2024
2 parents 53aca5f + f006aa3 commit abdc3fa
Showing 1 changed file with 12 additions and 1 deletion.
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

0 comments on commit abdc3fa

Please sign in to comment.