From fbdf9581c48b938bc80ba29a57d407ba4c0fded9 Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Wed, 12 Feb 2025 11:00:46 -0600 Subject: [PATCH] port 4201 + port 3001 for api + some fixes --- api/src/app/app.controller.ts | 4 ++-- api/src/app/app.service.ts | 3 +-- api/src/main.ts | 2 +- project.json | 5 ++++- proxy.conf.json | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/api/src/app/app.controller.ts b/api/src/app/app.controller.ts index 142224a..f76b260 100644 --- a/api/src/app/app.controller.ts +++ b/api/src/app/app.controller.ts @@ -1,4 +1,4 @@ -import { Body, Controller, Get, Post } from '@nestjs/common'; +import { Body, Controller, Post } from '@nestjs/common'; import { AppService } from './app.service'; @@ -7,7 +7,7 @@ export class AppController { constructor(private readonly appService: AppService) {} @Post() - async sendEMail(@Body() mailInfo: {name:string,email:String,message:string}): Promise { + async sendEMail(@Body() mailInfo: {name:string,email:string,message:string}): Promise { return await this.appService.sendMail(mailInfo); } } diff --git a/api/src/app/app.service.ts b/api/src/app/app.service.ts index 600e4f6..e571939 100644 --- a/api/src/app/app.service.ts +++ b/api/src/app/app.service.ts @@ -1,6 +1,5 @@ import { BadRequestException, Injectable } from '@nestjs/common'; -import { join } from 'path'; import { MailerService } from '@nestjs-modules/mailer'; import { z,ZodError } from 'zod'; export const SenderSchema = z.object({ @@ -13,7 +12,7 @@ export class AppService { constructor( private mailerService: MailerService, ) {} - async sendMail(mailInfo: {name:string,email:String,message:string}): Promise { + async sendMail(mailInfo: {name:string,email:string,message:string}): Promise { try { SenderSchema.parse(mailInfo); } catch (error) { diff --git a/api/src/main.ts b/api/src/main.ts index 7c10739..f2e0243 100644 --- a/api/src/main.ts +++ b/api/src/main.ts @@ -17,7 +17,7 @@ async function bootstrap() { methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', allowedHeaders: 'Content-Type, Accept, Authorization, x-hide-loading', }); - const port = 3000;//process.env.PORT || 3000; + const port = 3001;//process.env.PORT || 3000; await app.listen(port); Logger.log( `🚀 Application is running on: http://localhost:${port}/${globalPrefix}` diff --git a/project.json b/project.json index c2069fb..a2cf9fb 100644 --- a/project.json +++ b/project.json @@ -90,7 +90,10 @@ "buildTarget": "bay-area-affiliates__:build:development" } }, - "defaultConfiguration": "development" + "defaultConfiguration": "development", + "options": { + "port": 4201 + } }, "extract-i18n": { "executor": "@angular-devkit/build-angular:extract-i18n" diff --git a/proxy.conf.json b/proxy.conf.json index 4d16948..519f6ed 100644 --- a/proxy.conf.json +++ b/proxy.conf.json @@ -1,6 +1,6 @@ { "/api": { - "target": "http://localhost:3000", + "target": "http://localhost:3001", "secure": false, "changeOrigin": true, "pathRewrite": { "^/api": "" }