Skip to content

Commit

Permalink
fix: add types where it should be
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexinhans committed Jan 21, 2024
1 parent 9bae5b7 commit 2a551b3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/api/system-health.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { MessageResponse } from '../interfaces/response-interfaces';
const router = express.Router();

router.get<object, MessageResponse>('/', (req, res) => {
res.status(200);
res.json({
message: 'healthy',
message: 'healthy man',
status: 200,
});
});
Expand Down
5 changes: 4 additions & 1 deletion src/api/v1/main.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import express from 'express';
import { MessageResponse } from '../../interfaces/response-interfaces';

const router = express.Router();

router.get('/', (req, res) => {
router.get<object, MessageResponse>('/', (req, res) => {
res.status(200);
res.json({
message: 'hello human',
status: 200,
});
});

Expand Down
10 changes: 7 additions & 3 deletions src/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import morgan from 'morgan';
import { Logger } from 'tslog';
import endpoints from './api';
import { Endpoints } from './interfaces';
import { MessageResponse } from './interfaces/response-interfaces';
import { isDeveloperMode } from './lib/env';
import { errorHandler, notFoundHandler } from './middlewares';

Expand All @@ -17,9 +18,12 @@ app.use(helmet());
app.use(cors());
app.use(express.json());

app.get('/', (req, res) => {
// TODO:
res.redirect('https://google.com');
app.get<object, MessageResponse>('/', (req, res) => {
res.status(200);
res.json({
message: 'hm? what you want',
status: 200,
});
});

const registerEndpoints = (es: Endpoints, parentRoute: string = '') =>
Expand Down

0 comments on commit 2a551b3

Please sign in to comment.