@wwawing/debug-server 3.13.0-unstable.based-on.3.12.10.p.2 → 3.13.0-unstable.based-on.3.12.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/wwa-server.exe +0 -0
- package/lib/index.js +10 -10
- package/package.json +2 -2
package/bin/wwa-server.exe
CHANGED
|
Binary file
|
package/lib/index.js
CHANGED
|
@@ -3,26 +3,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const express_1 = __importDefault(require("express"));
|
|
7
|
+
const serve_index_1 = __importDefault(require("serve-index"));
|
|
8
|
+
const baseDir = process.argv.length < 3 ? "." : process.argv[2];
|
|
9
|
+
const DEFAULT_PORT = 3000;
|
|
10
10
|
function parseServerPort(port) {
|
|
11
11
|
if (!port) {
|
|
12
12
|
return DEFAULT_PORT;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
const parsedPort = parseInt(port, 10);
|
|
15
15
|
if (Number.isNaN(parsedPort)) {
|
|
16
16
|
return DEFAULT_PORT;
|
|
17
17
|
}
|
|
18
18
|
return parsedPort;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const app = (0, express_1.default)();
|
|
21
|
+
const SERVER_PORT = parseServerPort(process.env.WWA_SERVER_PORT);
|
|
22
22
|
app.use("/", express_1.default.static(baseDir), (0, serve_index_1.default)(baseDir, { icons: true }));
|
|
23
|
-
app.listen(SERVER_PORT,
|
|
23
|
+
app.listen(SERVER_PORT, () => {
|
|
24
24
|
console.log("Welcome to WWA Server!");
|
|
25
|
-
console.log(
|
|
26
|
-
console.log(
|
|
25
|
+
console.log(`http://localhost:${SERVER_PORT} でローカルでマップの仕上がりを確認できます。`);
|
|
26
|
+
console.log(`例: http://localhost:${SERVER_PORT}/wwamap.html`);
|
|
27
27
|
console.log("Ctrl+C もしくはこの画面を閉じると終了します。");
|
|
28
28
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wwawing/debug-server",
|
|
3
|
-
"version": "3.13.0-unstable.based-on.3.12.
|
|
3
|
+
"version": "3.13.0-unstable.based-on.3.12.11",
|
|
4
4
|
"description": "wwawing debug server",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"node": ">=18",
|
|
35
35
|
"npm": ">=8"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "04edb690b8551ec50ecd720bb3da2dcff6746c5b"
|
|
38
38
|
}
|