mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
优化路由
This commit is contained in:
parent
5d5535ed6e
commit
d6fb62c424
1 changed files with 7 additions and 0 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue