Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/umvoltoja.mp3
Binary file not shown.
17 changes: 17 additions & 0 deletions src/controllers/healthz.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Injectable } from '@decorators/di';
import { Controller, Get, Response } from '@decorators/express';
import * as Express from 'express';

@Controller('/healthz')
@Injectable()
export class HealthController {
@Get('/')
public getHealth(@Response() res: Express.Response) {
return res.status(200).send('OK');
}

@Get('/jpp')
public getJpp(@Response() res: Express.Response) {
return res.status(200).sendFile('umvoltoja.mp3', { root: `${__dirname}/../../public` });
}
}
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { WebhookController } from './controllers/webhook';
import { NotificationController } from './controllers/notifications';
import { Email } from './external/Email';
import { ReportsController } from './controllers/reports';
import { HealthController } from './controllers/healthz';

// ENV
import { config } from 'dotenv-cra';
Expand Down Expand Up @@ -112,7 +113,8 @@ export const main = async () => {
NotificationController,
ProducersController,
WebhookController,
ReportsController
ReportsController,
HealthController
]);

app.use('/', (_req, res) => {
Expand Down