added page 404

This commit is contained in:
2025-12-27 16:48:57 +01:00
parent 25ea30f086
commit 487e24a20a
2 changed files with 149 additions and 0 deletions

View File

@@ -77,6 +77,16 @@ async function viewsRoutes(fastify: FastifyInstance) {
const stream = fs.createReadStream(path.join(__dirname, '..', '..', 'views', 'books', 'read.html'));
reply.type('text/html').send(stream);
});
fastify.setNotFoundHandler((req, reply) => {
const stream = fs.createReadStream(path.join(__dirname, '..', '..', 'views', '404.html'));
reply
.code(404)
.type('text/html')
.send(stream)
})
}
export default viewsRoutes;