Add project files.

master
Tudor Stanciu 2023-01-17 23:14:05 +02:00
parent a685d983ad
commit 3c71b12f28
7 changed files with 125 additions and 0 deletions

25
Correo.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33205.214
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Correo", "Correo\Correo.csproj", "{B712E585-E63F-4A6D-8E17-FEFACE04BBE2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B712E585-E63F-4A6D-8E17-FEFACE04BBE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B712E585-E63F-4A6D-8E17-FEFACE04BBE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B712E585-E63F-4A6D-8E17-FEFACE04BBE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B712E585-E63F-4A6D-8E17-FEFACE04BBE2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {86FCF989-26FC-41E9-8A23-9485606D619D}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Mvc;
namespace Correo.Controllers
{
[ApiController]
[Route("[controller]")]
public class SystemController : ControllerBase
{
private readonly ILogger<SystemController> _logger;
public SystemController(ILogger<SystemController> logger)
{
_logger = logger;
}
[HttpGet("ping")]
public string Get()
{
return $"Ping success. System datetime: {DateTime.Now}";
}
}
}

13
Correo/Correo.csproj Normal file
View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>
</Project>

34
Correo/Program.cs Normal file
View File

@ -0,0 +1,34 @@
namespace Correo
{
public class Program
{
public static void Main(string[] args)
{
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseAuthorization();
app.MapControllers();
app.Run();
}
}
}

View File

@ -0,0 +1,14 @@
{
"profiles": {
"Correo": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5061",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

View File

@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

9
Correo/appsettings.json Normal file
View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}