Skip to content

Instantly share code, notes, and snippets.

@marianocodes
Last active May 30, 2019 02:04
Show Gist options
  • Save marianocodes/5d6930498f9d2275baf151b1464def48 to your computer and use it in GitHub Desktop.
Save marianocodes/5d6930498f9d2275baf151b1464def48 to your computer and use it in GitHub Desktop.
Convector with NestJS - Participant Controller
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