17 lines
441 B
TypeScript
17 lines
441 B
TypeScript
import { Body, Controller, Get, Post } from '@nestjs/common';
|
|
|
|
import { AppService } from './app.service';
|
|
|
|
@Controller()
|
|
export class AppController {
|
|
constructor(private readonly appService: AppService) {}
|
|
@Get()
|
|
getTest() {
|
|
return { message: 'API is alive' };
|
|
}
|
|
@Post()
|
|
async sendEMail(@Body() mailInfo: {name:string,email:string,message:string}): Promise<void> {
|
|
return await this.appService.sendMail(mailInfo);
|
|
}
|
|
}
|