Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INFRA: UsefulTime Api Project Initialize #2

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions UsefulTime.Api/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//=================================================
//Copyright (c) Coalition of Good-Hearted Engineers
//Free To Use To Find Comfort and Pease
//=================================================
using Microsoft.AspNetCore.Mvc;
using RESTFulSense.Controllers;

namespace UsefulTime.Api.Controllers
{
[ApiController]
[Route("api/[controller]")]
public class HomeController : RESTFulController
{
[HttpGet]
public ActionResult<string> Get() =>
Ok("Hello Mario, the princess is in another castle.");
}
}
25 changes: 25 additions & 0 deletions UsefulTime.Api/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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.UseHttpsRedirection();

app.UseAuthorization();

app.MapControllers();

app.Run();
41 changes: 41 additions & 0 deletions UsefulTime.Api/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:8937",
"sslPort": 44321
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5156",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7257;http://localhost:5156",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
14 changes: 14 additions & 0 deletions UsefulTime.Api/UsefulTime.Api.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="RESTFulSense" Version="3.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions UsefulTime.Api/UsefulTime.Api.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@UsefulTime.Api_HostAddress = http://localhost:5156

GET {{UsefulTime.Api_HostAddress}}/weatherforecast/
Accept: application/json

###
8 changes: 8 additions & 0 deletions UsefulTime.Api/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
9 changes: 9 additions & 0 deletions UsefulTime.Api/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
6 changes: 6 additions & 0 deletions UsefulTime.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 17.10.34902.84
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsefulTime.Build.Project", "UsefulTime.Build.Project\UsefulTime.Build.Project.csproj", "{8AEE94B6-7922-441A-BA9E-B7F84FB0D235}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsefulTime.Api", "UsefulTime.Api\UsefulTime.Api.csproj", "{D7F4508D-85FA-4537-ACA3-170FAEDC9C3F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +17,10 @@ Global
{8AEE94B6-7922-441A-BA9E-B7F84FB0D235}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8AEE94B6-7922-441A-BA9E-B7F84FB0D235}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8AEE94B6-7922-441A-BA9E-B7F84FB0D235}.Release|Any CPU.Build.0 = Release|Any CPU
{D7F4508D-85FA-4537-ACA3-170FAEDC9C3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7F4508D-85FA-4537-ACA3-170FAEDC9C3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7F4508D-85FA-4537-ACA3-170FAEDC9C3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7F4508D-85FA-4537-ACA3-170FAEDC9C3F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading