1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 14:48:08 +02:00

Add a port option to gulp server

This commit is contained in:
Calixte Denizet 2024-06-27 18:57:00 +02:00
parent af16aa62ad
commit f006aa36d1

View file

@ -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();
}
)