fixed a bug & replicated all changes to docker version
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user