返回提交历史
Modified
package.json
+1
-1
Modified
src/routes/webui.ts
+3
-2
XFEstudio/XFESpaceNinjaServer
fix: npm run build && npm run start (again) (#263)
259822d6
代码差异
2 个文件
+4
-3
@@ -6,7 +6,7 @@
6
6
"scripts": {
7
7
"start": "node --import ./build/src/pathman.js build/src/index.js",
8
8
"dev": "ts-node-dev --openssl-legacy-provider -r tsconfig-paths/register src/index.ts ",
9
"build": "tsc && copyfiles static/webui/* build",
9
"build": "tsc && copyfiles static/webui/** build",
10
10
"lint": "eslint --ext .ts .",
11
11
"lint:fix": "eslint --fix --ext .ts .",
12
12
"prettier": "prettier --write ."
@@ -3,6 +3,7 @@ import path from "path";
3
3
4
4
const webuiRouter = express.Router();
5
5
const rootDir = path.join(__dirname, "../..");
6
const repoDir = path.basename(rootDir) == "build" ? path.join(rootDir, "..") : rootDir;
6
7
7
8
// Redirect / to /webui/
8
9
webuiRouter.get("/", (_req, res) => {
@@ -35,10 +36,10 @@ webuiRouter.get("/favicon.ico", (_req, res) => {
35
36
36
37
// Serve warframe-riven-info
37
38
webuiRouter.get("/webui/riven-tool/", (_req, res) => {
38
res.sendFile(path.join(rootDir, "node_modules/warframe-riven-info/index.html"));
39
res.sendFile(path.join(repoDir, "node_modules/warframe-riven-info/index.html"));
39
40
});
40
41
webuiRouter.get("/webui/riven-tool/RivenParser.js", (_req, res) => {
41
res.sendFile(path.join(rootDir, "node_modules/warframe-riven-info/RivenParser.js"));
42
res.sendFile(path.join(repoDir, "node_modules/warframe-riven-info/RivenParser.js"));
42
43
});
43
44
44
45
export { webuiRouter };