Skip to content

Commit

Permalink
fix: fix empty env value (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuke4869 committed Sep 23, 2024
1 parent 5105e3f commit 4fb7872
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/db/kv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class KV {

static async getInstance(): Promise<KV> {
if (this.instance === null) {
const KV_PATH = Deno.env.get("KV_PATH");
const KV_PATH = Deno.env.get("KV_PATH") || undefined;
const kv = await Deno.openKv(KV_PATH);
this.instance = new KV(kv);
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "../controllers/api.ts";
import { sendAPIAccessLog } from "../services/log.ts";

const apiKeys = Deno.env.get("API_KEYS")?.split(",") ?? [];
const apiKeys = Deno.env.get("API_KEYS")?.split(",").filter(Boolean) ?? [];

const api = new Hono();

Expand Down

0 comments on commit 4fb7872

Please sign in to comment.