Skip to content

Commit c6f876e

Browse files
fix bullshit hopefully
1 parent 63bdbe4 commit c6f876e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

deno.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"imports": {
3-
"@db/mongo": "jsr:@db/mongo@^0.34.0",
4-
"@hono/hono": "jsr:@hono/hono@^4.11.1"
3+
"@hono/hono": "jsr:@hono/hono@^4.11.1",
4+
"mongodb": "npm:mongodb@^7.0.0"
55
},
66
"fmt": {
77
"indentWidth": 4,
@@ -18,7 +18,9 @@
1818
"permissions": {
1919
"default": {
2020
"env": true,
21-
"net": true
21+
"net": true,
22+
"read": true,
23+
"sys": true
2224
}
2325
},
2426
"tasks": {

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Hono } from "@hono/hono";
22
import { bearerAuth } from "@hono/hono/bearer-auth";
33
import { logger } from "@hono/hono/logger";
4-
import { MongoClient } from "@db/mongo";
4+
import { MongoClient } from "mongodb";
55

66
const app = new Hono();
77

@@ -12,11 +12,11 @@ interface TokenDoc {
1212
}
1313

1414
// Connect to MongoDB
15-
const client = new MongoClient();
1615
const mongo_uri = Deno.env.get("MONGODB_URI")!;
17-
await client.connect(mongo_uri); // Make sure to connect before using
16+
const client = new MongoClient(mongo_uri);
17+
await client.connect();
1818

19-
const db = client.database("ollama");
19+
const db = client.db("ollama");
2020
const collection = db.collection<TokenDoc>("tokens");
2121

2222
function removeTrailingSlash(str: string): string {

0 commit comments

Comments
 (0)