Skip to content

Commit

Permalink
fix: pass database to request handler
Browse files Browse the repository at this point in the history
  • Loading branch information
darlanalves authored Jul 15, 2024
1 parent 2416c72 commit 9895791
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ export function getDatabase(): Database {

export function serve() {
const db = getDatabase();

const server = createServer(handleRequest);
const server = createServer((req, res) => handleRequest(req, res, db);

server.listen(process.env.PORT);

Expand Down

0 comments on commit 9895791

Please sign in to comment.