diff --git a/.vscode/launch.json b/.vscode/launch.json index 895608b2..56a2750b 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -40,7 +40,8 @@ "program": "${workspaceFolder}/main.go", "console": "integratedTerminal", "args": [ - "ls" + "run", + "cli" ], "env": { "SMALLWEB_DIR": "${workspaceFolder}/example", diff --git a/example/.smallweb/config.jsonc b/example/.smallweb/config.jsonc index f17b991e..a4383036 100644 --- a/example/.smallweb/config.jsonc +++ b/example/.smallweb/config.jsonc @@ -1,10 +1,15 @@ { "$schema": "../../schemas/config.schema.json", - "domain": "smallweb.traefik.me", - "oidc": { - "issuer": "https://lastlogin.net" - }, - "authorizedEmails": [ - "achille.lacoin@gmail.com" - ] + "domain": "smallweb.live", + "apps": { + "example-cron": { + "crons": [ + { + "schedule": "* * * * *", + // ceci est un test + "args": [] + } + ] + } + } } diff --git a/example/cron/smallweb.json b/example/cron/smallweb.json deleted file mode 100644 index a94db73d..00000000 --- a/example/cron/smallweb.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "crons": [ - { - "schedule": "* * * * *", - "args": [] - } - ] -} diff --git a/example/cron/main.ts b/example/example-cron/main.ts similarity index 100% rename from example/cron/main.ts rename to example/example-cron/main.ts diff --git a/example/ls/data b/example/ls/data new file mode 120000 index 00000000..a96aa0ea --- /dev/null +++ b/example/ls/data @@ -0,0 +1 @@ +.. \ No newline at end of file diff --git a/example/ls/main.ts b/example/ls/main.ts index 687ffc3a..54ad6872 100644 --- a/example/ls/main.ts +++ b/example/ls/main.ts @@ -1,6 +1,9 @@ +import { Smallweb } from "jsr:@smallweb/sdk" + async function handleRequest() { - const { SMALLWEB_DOMAIN, SMALLWEB_DIR } = Deno.env.toObject() - const entries = await Array.fromAsync(Deno.readDir(SMALLWEB_DIR)) + const smallweb = new Smallweb("./data") + const apps = await smallweb.apps.list() + const html = /* html */`