feat(backend): Replace Node.js API with .NET 8
This commit completes the migration of the backend service from a Node.js/Express application to an ASP.NET Core 8 Minimal API. - Re-implemented all API endpoints in C# for improved performance and type safety. - Updated the Gitea Actions workflow to use the `setup-dotnet` action, `dotnet publish` for building, and now caches NuGet packages. - Modified the deployment to create an `appsettings.Production.json` file from Gitea secrets instead of a `.env` file. - Updated the PM2 ecosystem configuration to run the application using the `dotnet` interpreter.
This commit is contained in:
15
backend/JoaoLoureiro.Portfolio.Api/Mapping/MappingProfile.cs
Normal file
15
backend/JoaoLoureiro.Portfolio.Api/Mapping/MappingProfile.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using AutoMapper;
|
||||
using JoaoLoureiro.Portfolio.Api.Dtos;
|
||||
using JoaoLoureiro.Portfolio.Core.Models;
|
||||
|
||||
namespace JoaoLoureiro.Portfolio.Api.Mapping;
|
||||
|
||||
public class MappingProfile : Profile
|
||||
{
|
||||
public MappingProfile() {
|
||||
CreateMap<ContactMessageRequest, EmailToSend>()
|
||||
.ForMember(dest => dest.SenderName, opt => opt.MapFrom(src => src.Name))
|
||||
.ForMember(dest => dest.ReplyToEmail, opt => opt.MapFrom(src => src.Email))
|
||||
.ForMember(dest => dest.MessageBody, opt => opt.MapFrom(src => src.Message));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user