File size: 715 Bytes
f07dbc4
 
 
 
 
 
 
 
eacfb4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f07dbc4
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  getInfo() {
    return {
      service: 'M-Pesa Hash Decoder Wrapper API',
      status: 'active',
      version: '1.0.0',
      endpoints: {
        decode: '/decode/{hash}',
        info: '/decode/',
        health: '/health',
      },
      description:
        'NestJS wrapper for decodehash.com free M-Pesa hash decoding service',
    };
  }

  @Get('health')
  getHealth() {
    return {
      status: 'healthy',
      timestamp: new Date().toISOString(),
      uptime: process.uptime(),
    };
  }
}