mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-18 06:17:06 +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
|
return reply
|
||||||
})
|
})
|
||||||
fastify.setNotFoundHandler((request, reply) => {
|
fastify.setNotFoundHandler((request, reply) => {
|
||||||
if (request.method === 'GET') {
|
if (request.method == 'GET') {
|
||||||
reply.sendFile('plugins/chatgpt-plugin/server/static/index.html')
|
const stream = fs.createReadStream('plugins/chatgpt-plugin/server/static/index.html')
|
||||||
|
reply.type('text/html').send(stream)
|
||||||
} else {
|
} else {
|
||||||
reply.code(404).send(new Error('Not Found'))
|
reply.code(404).send(new Error('Not Found'))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue