From b9993c32999062d366329b924e8ca3ea64b0d87a Mon Sep 17 00:00:00 2001 From: Hadeed Ahmad Date: Mon, 7 Oct 2024 11:59:46 +0500 Subject: [PATCH] Change field name --- Program.cs | 6 +++--- docker-compose.yml | 9 +++++---- pages.sln | 16 ---------------- 3 files changed, 8 insertions(+), 23 deletions(-) delete mode 100644 pages.sln diff --git a/Program.cs b/Program.cs index 1a76027..202f3e0 100644 --- a/Program.cs +++ b/Program.cs @@ -16,10 +16,10 @@ app.UseStaticFiles(new StaticFileOptions { }); app.MapPost("/pages/{projectName}", async (string projectName, HttpRequest request) => { - if (!request.HasFormContentType || request.Form.Files["content"] is null) + if (!request.HasFormContentType || request.Form.Files["zipfile"] is null) return Results.BadRequest(); - IFormFile zipFile = request.Form.Files["content"]!; + IFormFile zipFile = request.Form.Files["zipfile"]!; if (zipFile.Length == 0) return Results.BadRequest(); @@ -57,4 +57,4 @@ string? GetBearerToken(HttpContext httpContext) { StringComparison.OrdinalIgnoreCase) ? authHeader["Bearer ".Length..].Trim() : null; -} \ No newline at end of file +} diff --git a/docker-compose.yml b/docker-compose.yml index c4098e7..d0715a6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,14 +1,15 @@ -version: '3.8' - services: pages: build: context: . image: pages:latest - container_name: pages environment: API_TOKEN: "api_token" ASPNETCORE_HTTP_PORTS: 80 + volumes: + - pages_data:/app/wwwroot ports: - "8080:80" - restart: unless-stopped \ No newline at end of file + +volumes: + pages_data: diff --git a/pages.sln b/pages.sln deleted file mode 100644 index e02bc62..0000000 --- a/pages.sln +++ /dev/null @@ -1,16 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pages", "pages.csproj", "{8B60FB6E-60A3-4E00-A843-6293B8E5C8BF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8B60FB6E-60A3-4E00-A843-6293B8E5C8BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8B60FB6E-60A3-4E00-A843-6293B8E5C8BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8B60FB6E-60A3-4E00-A843-6293B8E5C8BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8B60FB6E-60A3-4E00-A843-6293B8E5C8BF}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal