Commit 80e5f37c authored by Maxime's avatar Maxime
Browse files

update api

parent bd9c9f3f
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
\ No newline at end of file
......@@ -5,12 +5,12 @@ namespace WebAPI.Controller
{
[ApiController]
[Route("[controller]")]
public class GamController : ControllerBase
public class GameController : ControllerBase
{
[HttpPost("CreateSession")]
public Server CreateSession()
{
return new Server("192.168.1.22",3000,"*****");
return new Server("192.168.1.22", 3000, "*****");
}
}
}
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["WebAPI/WebAPI.csproj", "WebAPI/"]
RUN dotnet restore "WebAPI/WebAPI.csproj"
COPY . .
WORKDIR "/src/WebAPI"
RUN dotnet build "WebAPI.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "WebAPI.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WebAPI.dll"]
\ No newline at end of file
......@@ -15,3 +15,7 @@ app.UseSwaggerUI(c =>
app.UseAuthorization();
app.MapControllers();
app.Run();
......@@ -3,8 +3,8 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:51919",
"sslPort": 44378
"applicationUrl": "http://localhost:3118",
"sslPort": 44303
}
},
"profiles": {
......@@ -14,7 +14,7 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:7236;http://localhost:5236",
"applicationUrl": "https://localhost:7009;http://localhost:5009",
"dotnetRunMessages": true
},
"IIS Express": {
......@@ -24,6 +24,16 @@
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"WSL": {
"commandName": "WSL2",
"launchBrowser": true,
"launchUrl": "https://localhost:7009",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_URLS": "https://localhost:7009;http://localhost:5009"
},
"distributionName": ""
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
......
......@@ -4,12 +4,9 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>8fbbbf8a-44fa-483f-afce-01f84b42e293</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.2.3" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="6.2.3" />
......
......@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAPI", "WebAPI\WebAPI.csproj", "{F9265805-9EEC-48DF-AB33-E1544A873F37}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAPI", "WebAPI\WebAPI.csproj", "{C18B6F15-7431-4657-956D-6A2CC8D4CBA6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -11,10 +11,10 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F9265805-9EEC-48DF-AB33-E1544A873F37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9265805-9EEC-48DF-AB33-E1544A873F37}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9265805-9EEC-48DF-AB33-E1544A873F37}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9265805-9EEC-48DF-AB33-E1544A873F37}.Release|Any CPU.Build.0 = Release|Any CPU
{C18B6F15-7431-4657-956D-6A2CC8D4CBA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C18B6F15-7431-4657-956D-6A2CC8D4CBA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C18B6F15-7431-4657-956D-6A2CC8D4CBA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C18B6F15-7431-4657-956D-6A2CC8D4CBA6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment