• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

HernanEstribou / take-home-hernan / efb9a06e-410f-4305-9ca7-9ad80eb1bade

03 Apr 2026 10:22PM UTC coverage: 81.56% (-1.0%) from 82.564%
efb9a06e-410f-4305-9ca7-9ad80eb1bade

push

circleci

HernanEstribou
feat: implement notifications feature with CRUD operations, JWT authentication, and update Swagger documentation

92 of 119 branches covered (77.31%)

Branch coverage included in aggregate %.

0 of 3 new or added lines in 3 files covered. (0.0%)

15 existing lines in 2 files now uncovered.

253 of 304 relevant lines covered (83.22%)

5.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.22
/src/app.js
1
import cors from 'cors';
2
import 'dotenv/config';
3
import express from 'express';
4
import authRouter from './auth/auth.controller.js';
5
import usersRouter from './users/users.controller.js';
6
import notificationsRouter from './notifications/notifications.controller.js';
7
import swaggerUi from 'swagger-ui-express';
8
import swaggerDocumentation from './swagger/swagger.json' with { type: 'json' };
9
import './config/database.js';
10

11
const app = express();
4✔
12
const port = process.env.PORT || 3000;
4✔
13

14
// Trust proxy - required for Heroku to detect HTTPS correctly
15
app.set('trust proxy', 1);
4✔
16

17
app.use(express.json());
4✔
18
app.use(cors());
4✔
19

20
// Swagger setup with dynamic scheme detection
21
app.use('/api-docs', swaggerUi.serve, (req, res, next) => {
4✔
UNCOV
22
  const protocol = req.protocol; // 'http' or 'https'
×
UNCOV
23
  const swaggerDoc = { ...swaggerDocumentation };
×
24

25
  // Set schemes based on protocol: current protocol first
UNCOV
26
  swaggerDoc.schemes =
×
27
    protocol === 'https' ? ['https', 'http'] : ['http', 'https'];
×
28

UNCOV
29
  swaggerUi.setup(swaggerDoc)(req, res, next);
×
30
});
31

32
app.use('/auth', authRouter);
4✔
33
app.use('/users', usersRouter);
4✔
34
app.use('/notifications', notificationsRouter);
4✔
35

36
if (process.env.NODE_ENV !== 'test') {
4✔
UNCOV
37
  app.listen(port, () => {
×
UNCOV
38
    console.log(`App listening on port ${port}`);
×
39
  });
40
}
41

42
export default app;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc