move templates to views

This commit is contained in:
Holly Stubbs 2024-09-28 10:32:33 +01:00
parent ad7384c529
commit b8913702ae
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E
19 changed files with 12 additions and 12 deletions

View file

@ -78,7 +78,7 @@ fastify.register(FastifyStatic, {
});
fastify.setNotFoundHandler(async (req, res) => {
return res.status(404).view("templates/404.ejs", { });
return res.status(404).view("views/404.ejs", { });
});
Controller.FastifyInstance = fastify;

View file

@ -32,7 +32,7 @@ export default class RequestCtx {
viewModel["session"] = this.session;
// @ts-ignore inject enums
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

View file

@ -23,13 +23,13 @@
},
"devDependencies": {
"@types/ejs": "^3.1.5",
"@types/node": "^22.6.0",
"@types/node": "^22.7.4",
"@types/ws": "^8.5.12",
"@vercel/ncc": "^0.38.2",
"check-outdated": "^2.12.0",
"nodemon": "^3.1.7",
"npm-run-all": "^4.1.5",
"terser": "^5.33.0",
"terser": "^5.34.1",
"ts-node": "^10.9.2",
"typescript": "^5.6.2"
}
@ -279,9 +279,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "22.6.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.6.0.tgz",
"integrity": "sha512-QyR8d5bmq+eR72TwQDfujwShHMcIrWIYsaQFtXRE58MHPTEKUNxjxvl0yS0qPMds5xbSDWtp7ZpvGFtd7dfMdQ==",
"version": "22.7.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.4.tgz",
"integrity": "sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -3237,9 +3237,9 @@
}
},
"node_modules/terser": {
"version": "5.33.0",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.33.0.tgz",
"integrity": "sha512-JuPVaB7s1gdFKPKTelwUyRq5Sid2A3Gko2S0PncwdBq7kN9Ti9HPWDQ06MPsEDGsZeVESjKEnyGy68quBk1w6g==",
"version": "5.34.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.34.1.tgz",
"integrity": "sha512-FsJZ7iZLd/BXkz+4xrRTGJ26o/6VTjQytUk8b8OxkwcD2I+79VPJlz7qss1+zE7h8GNIScFqXcDyJ/KqBYZFVA==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {

View file

@ -29,13 +29,13 @@
},
"devDependencies": {
"@types/ejs": "^3.1.5",
"@types/node": "^22.6.0",
"@types/node": "^22.7.4",
"@types/ws": "^8.5.12",
"@vercel/ncc": "^0.38.2",
"check-outdated": "^2.12.0",
"nodemon": "^3.1.7",
"npm-run-all": "^4.1.5",
"terser": "^5.33.0",
"terser": "^5.34.1",
"ts-node": "^10.9.2",
"typescript": "^5.6.2"
}