move templates to views
This commit is contained in:
parent
ad7384c529
commit
b8913702ae
19 changed files with 12 additions and 12 deletions
|
@ -78,7 +78,7 @@ fastify.register(FastifyStatic, {
|
||||||
});
|
});
|
||||||
|
|
||||||
fastify.setNotFoundHandler(async (req, res) => {
|
fastify.setNotFoundHandler(async (req, res) => {
|
||||||
return res.status(404).view("templates/404.ejs", { });
|
return res.status(404).view("views/404.ejs", { });
|
||||||
});
|
});
|
||||||
|
|
||||||
Controller.FastifyInstance = fastify;
|
Controller.FastifyInstance = fastify;
|
||||||
|
|
|
@ -32,7 +32,7 @@ export default class RequestCtx {
|
||||||
viewModel["session"] = this.session;
|
viewModel["session"] = this.session;
|
||||||
// @ts-ignore inject enums
|
// @ts-ignore inject enums
|
||||||
viewModel["UserLevel"] = UserLevel;
|
viewModel["UserLevel"] = UserLevel;
|
||||||
return this.res.view(`templates/${this.controllerName}/${viewName}.ejs`, viewModel);
|
return this.res.view(`views/${this.controllerName}/${viewName}.ejs`, viewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: query params
|
// TODO: query params
|
||||||
|
|
16
server/package-lock.json
generated
16
server/package-lock.json
generated
|
@ -23,13 +23,13 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/ejs": "^3.1.5",
|
"@types/ejs": "^3.1.5",
|
||||||
"@types/node": "^22.6.0",
|
"@types/node": "^22.7.4",
|
||||||
"@types/ws": "^8.5.12",
|
"@types/ws": "^8.5.12",
|
||||||
"@vercel/ncc": "^0.38.2",
|
"@vercel/ncc": "^0.38.2",
|
||||||
"check-outdated": "^2.12.0",
|
"check-outdated": "^2.12.0",
|
||||||
"nodemon": "^3.1.7",
|
"nodemon": "^3.1.7",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"terser": "^5.33.0",
|
"terser": "^5.34.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.6.2"
|
"typescript": "^5.6.2"
|
||||||
}
|
}
|
||||||
|
@ -279,9 +279,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "22.6.0",
|
"version": "22.7.4",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz",
|
||||||
"integrity": "sha512-QyR8d5bmq+eR72TwQDfujwShHMcIrWIYsaQFtXRE58MHPTEKUNxjxvl0yS0qPMds5xbSDWtp7ZpvGFtd7dfMdQ==",
|
"integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -3237,9 +3237,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/terser": {
|
"node_modules/terser": {
|
||||||
"version": "5.33.0",
|
"version": "5.34.1",
|
||||||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.33.0.tgz",
|
"resolved": "https://registry.npmjs.org/terser/-/terser-5.34.1.tgz",
|
||||||
"integrity": "sha512-JuPVaB7s1gdFKPKTelwUyRq5Sid2A3Gko2S0PncwdBq7kN9Ti9HPWDQ06MPsEDGsZeVESjKEnyGy68quBk1w6g==",
|
"integrity": "sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -29,13 +29,13 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/ejs": "^3.1.5",
|
"@types/ejs": "^3.1.5",
|
||||||
"@types/node": "^22.6.0",
|
"@types/node": "^22.7.4",
|
||||||
"@types/ws": "^8.5.12",
|
"@types/ws": "^8.5.12",
|
||||||
"@vercel/ncc": "^0.38.2",
|
"@vercel/ncc": "^0.38.2",
|
||||||
"check-outdated": "^2.12.0",
|
"check-outdated": "^2.12.0",
|
||||||
"nodemon": "^3.1.7",
|
"nodemon": "^3.1.7",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"terser": "^5.33.0",
|
"terser": "^5.34.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.6.2"
|
"typescript": "^5.6.2"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue