mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
修复路由
This commit is contained in:
parent
d6fb62c424
commit
6e5ef2e1f5
1 changed files with 3 additions and 2 deletions
|
|
@ -51,8 +51,9 @@ async function routes(fastify, options) {
|
|||
return reply
|
||||
})
|
||||
fastify.setNotFoundHandler((request, reply) => {
|
||||
if (request.method === 'GET') {
|
||||
reply.sendFile('plugins/chatgpt-plugin/server/static/index.html')
|
||||
if (request.method == 'GET') {
|
||||
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/index.html')
|
||||
reply.type('text/html').send(stream)
|
||||
} else {
|
||||
reply.code(404).send(new Error('Not Found'))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue