generated from template/slidev-template
fix: add test
This commit is contained in:
1 parent
e81a475bba
commit
572f793061
4 files changed
+32
-1
No files matched your search
@@ -0,0 +1,13 @@
|
||||
import { createStorage } from "unstorage";
|
||||
import fsDriver from "unstorage/drivers/fs";
|
||||
import { CloudflareDDNS } from "@agent/ddns/cloudflare/index.ts";
|
||||
import { CloudflareConfig } from "@agent/task.ts";
|
||||
const storage = createStorage({
|
||||
driver: fsDriver({
|
||||
base: process.cwd() + '/storage/ddns-agent'
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
export const config = await storage.getItem<CloudflareConfig>('cloudflare.json');
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { CloudflareDDNS } from "@agent/ddns/cloudflare/index.ts";
|
||||
import { config } from "./common.ts";
|
||||
|
||||
const cf = new CloudflareDDNS();
|
||||
if (config) {
|
||||
const res = await cf.getList(config.zone_id, config.api_token);
|
||||
console.log('Cloudflare DNS Records List:', res);
|
||||
} else {
|
||||
console.log('No configuration found.');
|
||||
}
|
||||
Reference in new issue
Block a user