diff --git a/server/modules/web_route.js b/server/modules/web_route.js index 90bc9dc..289de22 100644 --- a/server/modules/web_route.js +++ b/server/modules/web_route.js @@ -50,6 +50,13 @@ async function routes(fastify, options) { reply.type('text/html').send(stream) return reply }) + fastify.setNotFoundHandler((request, reply) => { + if (request.method === 'GET') { + reply.sendFile('plugins/chatgpt-plugin/server/static/index.html') + } else { + reply.code(404).send(new Error('Not Found')) + } + }) } export default routes \ No newline at end of file