File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 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 ,
1818 "permissions" : {
1919 "default" : {
2020 "env" : true ,
21- "net" : true
21+ "net" : true ,
22+ "read" : true ,
23+ "sys" : true
2224 }
2325 },
2426 "tasks" : {
Original file line number Diff line number Diff line change 11import { Hono } from "@hono/hono" ;
22import { bearerAuth } from "@hono/hono/bearer-auth" ;
33import { logger } from "@hono/hono/logger" ;
4- import { MongoClient } from "@db/mongo " ;
4+ import { MongoClient } from "mongodb " ;
55
66const app = new Hono ( ) ;
77
@@ -12,11 +12,11 @@ interface TokenDoc {
1212}
1313
1414// Connect to MongoDB
15- const client = new MongoClient ( ) ;
1615const 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" ) ;
2020const collection = db . collection < TokenDoc > ( "tokens" ) ;
2121
2222function removeTrailingSlash ( str : string ) : string {
You can’t perform that action at this time.
0 commit comments