@@ -20,6 +20,7 @@ const koa_json_1 = __importDefault(require("koa-json"));
2020 const koa_logger_1 = __importDefault(require("koa-logger"));
2121 const koa_router_1 = __importDefault(require("koa-router"));
2222 const strip_ansi_1 = __importDefault(require("strip-ansi"));
23+const routes_1 = __importDefault(require("./auth/routes"));
2324 // try got and axios for server to server requests
2425 // Create the client to let prisma manage the connection pool
2526 const prisma = new client_1.PrismaClient();
@@ -36,8 +37,9 @@ function main() {
3637 app.use((0, koa_body_1.default)());
3738 app.use((0, cors_1.default)());
3839 // Share the connection for the db:
39- app.use((ctx) => __awaiter(this, void 0, void 0, function* () {
40+ app.use((ctx, next) => __awaiter(this, void 0, void 0, function* () {
4041 ctx.prisma = prisma;
42+ yield next();
4143 }));
4244 // health-check:
4345 router.get("/health-check", (ctx, next) => __awaiter(this, void 0, void 0, function* () {
@@ -49,7 +51,7 @@ function main() {
4951 }));
5052 // Serve configured routes:
5153 app.use(router.routes()).use(router.allowedMethods());
52- // app.use(auth_router.routes()).use(auth_router.allowedMethods());
54+ app.use(routes_1.default.routes()).use(routes_1.default.allowedMethods());
5355 // App starts
5456 app.listen(3001, () => {
5557 console.log("Server started...");