aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/routes/actual.remote.ts
diff options
context:
space:
mode:
authorivar <i@oiee.no>2025-12-10 00:17:27 +0100
committerivar <i@oiee.no>2025-12-10 00:17:27 +0100
commit57861411f37a07af3cd8fcf1520843e5a5e44bfc (patch)
tree86fdb1024fdadfcf6551cbb5da274beb791499d9 /app/src/routes/actual.remote.ts
downloadsparebank1-actualbudget-57861411f37a07af3cd8fcf1520843e5a5e44bfc.tar.xz
sparebank1-actualbudget-57861411f37a07af3cd8fcf1520843e5a5e44bfc.zip
Initial commit
Diffstat (limited to 'app/src/routes/actual.remote.ts')
-rw-r--r--app/src/routes/actual.remote.ts17
1 files changed, 17 insertions, 0 deletions
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