Fix server can not stop with Ctrl + C

This commit is contained in:
2023-05-25 12:06:12 +08:00
parent 614f05fc22
commit 800e8b9603
4 changed files with 27 additions and 1 deletions

View File

@@ -2,6 +2,8 @@ import { start } from "$fresh/server.ts";
import { Config } from "./config.ts";
import manifest from "./fresh.gen.ts";
import { TaskManager } from "./task_manager.ts";
import twindPlugin from "$fresh/plugins/twind.ts";
import twindConfig from "./twind.config.ts";
let task_manager: TaskManager | undefined = undefined;
@@ -12,5 +14,8 @@ export function get_task_manager() {
export function startServer(cfg: Config) {
task_manager = new TaskManager(cfg);
return start(manifest, {});
return start(manifest, {
signal: task_manager.aborts,
plugins: [twindPlugin(twindConfig)],
});
}