2022-03-10 16:09:03 -06:00
|
|
|
import { Controller, Get, Post, Body, Patch, Param, Delete, UseGuards } from '@nestjs/common';
|
|
|
|
|
import { ConfigService } from '@nestjs/config';
|
|
|
|
|
import { AuthUserDto, GetAuthUser } from '../../decorators/auth-user.decorator';
|
|
|
|
|
import { JwtAuthGuard } from '../../modules/immich-jwt/guards/jwt-auth.guard';
|
2022-02-03 10:06:44 -06:00
|
|
|
import { ServerInfoService } from './server-info.service';
|
2022-03-10 16:09:03 -06:00
|
|
|
import mapboxGeocoding, { GeocodeService } from '@mapbox/mapbox-sdk/services/geocoding';
|
|
|
|
|
import { MapiResponse } from '@mapbox/mapbox-sdk/lib/classes/mapi-response';
|
2022-02-03 10:06:44 -06:00
|
|
|
|
|
|
|
|
@Controller('server-info')
|
|
|
|
|
export class ServerInfoController {
|
2022-03-10 16:09:03 -06:00
|
|
|
constructor(private readonly serverInfoService: ServerInfoService, private readonly configService: ConfigService) {}
|
2022-02-03 10:06:44 -06:00
|
|
|
|
|
|
|
|
@Get()
|
|
|
|
|
async getServerInfo() {
|
|
|
|
|
return await this.serverInfoService.getServerInfo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Get('/ping')
|
|
|
|
|
async getServerPulse() {
|
|
|
|
|
return {
|
|
|
|
|
res: 'pong',
|
|
|
|
|
};
|
|
|
|
|
}
|
2022-03-10 16:09:03 -06:00
|
|
|
|
|
|
|
|
@UseGuards(JwtAuthGuard)
|
|
|
|
|
@Get('/mapbox')
|
|
|
|
|
async getMapboxInfo() {
|
|
|
|
|
return {
|
|
|
|
|
isEnable: this.configService.get('ENABLE_MAPBOX'),
|
|
|
|
|
mapboxSecret: this.configService.get('MAPBOX_KEY'),
|
|
|
|
|
};
|
|
|
|
|
}
|
2022-02-03 10:06:44 -06:00
|
|
|
}
|