Skip to content

Commit

Permalink
decorate context with db
Browse files Browse the repository at this point in the history
  • Loading branch information
jzweifel committed Oct 6, 2023
1 parent 0da0f80 commit 9323629
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/context/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { HoltLogger } from "@tlscipher/holt";
import { Elysia } from "elysia";
import { auth } from "../auth";
import { config } from "../config";
import { client as db } from "../db";
import { loggerConfig } from "../lib";

export const ctx = new Elysia({
Expand All @@ -20,6 +21,7 @@ export const ctx = new Elysia({
return { session };
})
.use(logger(loggerConfig))
.decorate("db", db)
.use(
// @ts-expect-error
config.env.NODE_ENV === "development"
Expand Down

0 comments on commit 9323629

Please # to comment.