From fc60d3a9ecde56f3bc5aa9fd776c12cb4d934aab Mon Sep 17 00:00:00 2001 From: musistudio Date: Thu, 25 Dec 2025 23:01:52 +0800 Subject: [PATCH] fix api --- packages/cli/src/utils/index.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/cli/src/utils/index.ts b/packages/cli/src/utils/index.ts index 4a6c312..282472c 100644 --- a/packages/cli/src/utils/index.ts +++ b/packages/cli/src/utils/index.ts @@ -14,8 +14,6 @@ import { checkForUpdates, performUpdate } from "./update"; import { version } from "../../package.json"; import { spawn } from "child_process"; import { cleanupPidFile } from "./processCheck"; -import fastifyStatic from "@fastify/static"; -import {join} from "path"; // Function to interpolate environment variables in config values const interpolateEnvVars = (obj: any): any => { @@ -185,13 +183,13 @@ export const run = async (args: string[] = []) => { // Save the PID of the background process writeFileSync(PID_FILE, process.pid.toString()); - // server.app.post('/api/update/perform', async () => { - // return await performUpdate(); - // }) - // - // server.app.get('/api/update/check', async () => { - // return await checkForUpdates(version); - // }) + server.app.post('/api/update/perform', async () => { + return await performUpdate(); + }) + + server.app.get('/api/update/check', async () => { + return await checkForUpdates(version); + }) server.app.post("/api/restart", async () => { setTimeout(async () => {