Skip to content

Commit 737010e

Browse files
committed
fix:handler
1 parent cc53fa6 commit 737010e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: index.js

+4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ const stop = async () => {
7373

7474
// 导出 start 和 stop 方法
7575
export {start, stop};
76+
export default async function handler(req, res) {
77+
await fastify.ready()
78+
fastify.server.emit('request', req, res)
79+
}
7680

7781
// 判断当前模块是否为主模块,如果是主模块,则启动服务
7882
const currentFile = path.normalize(fileURLToPath(import.meta.url)); // 使用 normalize 确保路径一致

0 commit comments

Comments
 (0)