Last active
May 30, 2019 02:04
-
-
Save marianocodes/5d6930498f9d2275baf151b1464def48 to your computer and use it in GitHub Desktop.
Convector with NestJS - Participant Controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller, Get, Param, Logger, HttpException, HttpStatus } from '@nestjs/common'; | |
import { ParticipantControllerBackEnd } from '../convector'; | |
@Controller('/participant') | |
export class ParticipantController { | |
@Get(':id') | |
public async getHello(@Param('id') id: string) { | |
try { | |
return await ParticipantControllerBackEnd.get(id); | |
} catch (err) { | |
Logger.log(JSON.stringify(err)); | |
throw new HttpException('Bad request', HttpStatus.BAD_REQUEST); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment