add GET Enppoint
This commit is contained in:
parent
d29260a919
commit
4d992fdae5
|
|
@ -1,11 +1,14 @@
|
||||||
import { Body, Controller, Post } from '@nestjs/common';
|
import { Body, Controller, Get, Post } from '@nestjs/common';
|
||||||
|
|
||||||
import { AppService } from './app.service';
|
import { AppService } from './app.service';
|
||||||
|
|
||||||
@Controller()
|
@Controller()
|
||||||
export class AppController {
|
export class AppController {
|
||||||
constructor(private readonly appService: AppService) {}
|
constructor(private readonly appService: AppService) {}
|
||||||
|
@Get()
|
||||||
|
getTest() {
|
||||||
|
return { message: 'API is alive' };
|
||||||
|
}
|
||||||
@Post()
|
@Post()
|
||||||
async sendEMail(@Body() mailInfo: {name:string,email:string,message:string}): Promise<void> {
|
async sendEMail(@Body() mailInfo: {name:string,email:string,message:string}): Promise<void> {
|
||||||
return await this.appService.sendMail(mailInfo);
|
return await this.appService.sendMail(mailInfo);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue