diff --git a/src/index.js b/src/index.js index fb7f9d2..7c322cb 100644 --- a/src/index.js +++ b/src/index.js @@ -7,11 +7,14 @@ const { ZodError } = require("zod"); const { env } = require("./env"); const { challenges } = require("./infra/http/challenge"); const { solution } = require("./infra/http/solution"); +const { manager } = require("./infra/database/manager"); const app = express(); app.use(express.json()); +app.use((req, res, next) => manager.connect().then(next)); + app.use(challenges); app.use(solution);