From 57861411f37a07af3cd8fcf1520843e5a5e44bfc Mon Sep 17 00:00:00 2001 From: ivar Date: Wed, 10 Dec 2025 00:17:27 +0100 Subject: Initial commit --- app/src/routes/actual.remote.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/src/routes/actual.remote.ts (limited to 'app/src/routes/actual.remote.ts') diff --git a/app/src/routes/actual.remote.ts b/app/src/routes/actual.remote.ts new file mode 100644 index 0000000..bcf5d37 --- /dev/null +++ b/app/src/routes/actual.remote.ts @@ -0,0 +1,17 @@ +import { command } from "$app/server"; +import { ACTUAL_HOST, ACTUAL_PASS } from "$env/static/private"; +import * as actual from "@actual-app/api" +import { existsSync, mkdirSync } from "node:fs"; +import path from "node:path"; + +export const initActual = command(async () => { + const dataDir = path.resolve(__dirname, "actualDataDir"); + + if (!existsSync(dataDir)) mkdirSync(dataDir); + + return actual.init({ + password: ACTUAL_PASS, + serverURL: ACTUAL_HOST, + dataDir: dataDir + }) +}) \ No newline at end of file -- cgit v1.3