feat: api/daemon/{start,stop,restart,status}

This commit is contained in:
2024-03-09 16:16:12 +00:00
parent ddfff44c12
commit c42a97bb5f
7 changed files with 136 additions and 5 deletions
+10 -4
View File
@@ -1,5 +1,5 @@
import type {
DefAPINamespace,
DefAPINamespace,
} from "@strpc/def";
import { GET, POST } from '@strpc/def';
@@ -17,11 +17,17 @@ import type {
export type {
InferResponse,
InferError,
InferQuery,
InferResponse,
InferError,
InferQuery,
} from "@strpc/def";
export type * as def from './def/index.js';
export const structure = {
daemon: {
status: GET<ValidResponse & { isRunning: boolean, lastExecuted?: string }>(),
start: POST<ValidResponse>(),
stop: POST<ValidResponse>(),
restart: POST<ValidResponse>(),
}
} satisfies DefAPINamespace;