File size: 522 Bytes
2d96a3f
df84e17
2d96a3f
 
 
 
b8f352b
2d96a3f
 
 
 
a4fbcb8
 
df84e17
a4fbcb8
 
 
 
 
 
 
 
2d96a3f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Controller, Get, Redirect } from '@nestjs/common';
import { SkipApiToken } from './shared/decorators/skip-api-token.decorator';

@Controller()
export class AppController {
  @Get()
  @SkipApiToken()
  @Redirect('/api', 301)
  redirectToApi() {
    // This will automatically redirect root path to /api
  }

  @Get('ping')
  @SkipApiToken()
  ping() {
    return {
      status: 'success',
      message: 'Ping Successfully',
      timestamp: new Date().toISOString(),
      uptime: process.uptime(),
    };
  }
}