File size: 383 Bytes
e538a38
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import type { PreviewServer, ViteDevServer } from "vite";
import { startRerankerService, stopRerankerService } from "./rerankerService";

export async function rerankerServiceHook<
  T extends ViteDevServer | PreviewServer,
>(server: T) {
  const serverProcess = await startRerankerService();

  server.httpServer?.on("close", () => {
    stopRerankerService(serverProcess);
  });
}