From 051f99301cd41d1a0c5ab030a7b34e97bd6acd90 Mon Sep 17 00:00:00 2001 From: ShadyNagy Date: Mon, 16 Dec 2024 19:12:59 +0200 Subject: [PATCH 01/14] - Vimeo updated to v1.0.9 and Start TUS log is used. --- Directory.Packages.props | 2 +- .../Services/CreateVideoService.cs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 5430aaa0d..121298a14 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -62,7 +62,7 @@ - + diff --git a/src/DevBetterWeb.Core/Services/CreateVideoService.cs b/src/DevBetterWeb.Core/Services/CreateVideoService.cs index 3fd70c407..e9b255d24 100644 --- a/src/DevBetterWeb.Core/Services/CreateVideoService.cs +++ b/src/DevBetterWeb.Core/Services/CreateVideoService.cs @@ -12,6 +12,8 @@ using NimblePros.Vimeo.Models; using NimblePros.Vimeo.VideoServices; using NimblePros.Vimeo.VideoTusService; +using static DevBetterWeb.Core.Entities.Member; +using static Microsoft.ApplicationInsights.MetricDimensionNames.TelemetryContext; namespace DevBetterWeb.Core.Services; public class CreateVideoService : ICreateVideoService @@ -20,13 +22,15 @@ public class CreateVideoService : ICreateVideoService private readonly IUploadVideoTusService _uploadVideoTusService; private readonly IRepository _repositoryArchiveVideo; private readonly IAddCreatedVideoToFolderService _addCreatedVideoToFolderService; + private readonly IAppLogger _logger; - public CreateVideoService(GetVideoService getVideoService, IUploadVideoTusService uploadVideoTusService, IRepository repositoryArchiveVideo, IAddCreatedVideoToFolderService addCreatedVideoToFolderService) + public CreateVideoService(IAppLogger logger, GetVideoService getVideoService, IUploadVideoTusService uploadVideoTusService, IRepository repositoryArchiveVideo, IAddCreatedVideoToFolderService addCreatedVideoToFolderService) { _getVideoService = getVideoService; _uploadVideoTusService = uploadVideoTusService; _repositoryArchiveVideo = repositoryArchiveVideo; _addCreatedVideoToFolderService = addCreatedVideoToFolderService; + _logger = logger; } public async Task StartAsync(string videoName, long videoSize, string domain, CancellationToken cancellationToken = default) @@ -40,9 +44,13 @@ public async Task StartAsync(string videoName, long videoSize, string do EmbedDomains = new List { domain }, HideFromVimeo = true }; - var sessionId = await _uploadVideoTusService.StartAsync(uploadVideoRequest, cancellationToken); + var responseSessionId = await _uploadVideoTusService.StartAsync(uploadVideoRequest, cancellationToken); + if (!responseSessionId.IsSuccess || string.IsNullOrEmpty(responseSessionId.Data)) + { + _logger.LogError(new Exception(responseSessionId.Exception.Message), responseSessionId.Json); + } - return sessionId; + return responseSessionId.Data; } public async Task UploadChunkAsync(bool isBaseFolder, string sessionId, string chunk, string? description, long? folderId, CancellationToken cancellationToken = default) From ec606e95258d77cf92959968560c795839e65273 Mon Sep 17 00:00:00 2001 From: ShadyNagy Date: Mon, 16 Dec 2024 21:03:27 +0200 Subject: [PATCH 02/14] - update to v1.0.10 --- Directory.Packages.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 121298a14..d733217c9 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -62,7 +62,7 @@ - + From 944a8e22abb771f6f9e07ec66d69cf659a45bc23 Mon Sep 17 00:00:00 2001 From: ShadyNagy Date: Fri, 20 Dec 2024 14:16:16 +0200 Subject: [PATCH 03/14] fix the log. --- src/DevBetterWeb.Core/Services/CreateVideoService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DevBetterWeb.Core/Services/CreateVideoService.cs b/src/DevBetterWeb.Core/Services/CreateVideoService.cs index e9b255d24..f7fe61344 100644 --- a/src/DevBetterWeb.Core/Services/CreateVideoService.cs +++ b/src/DevBetterWeb.Core/Services/CreateVideoService.cs @@ -47,7 +47,7 @@ public async Task StartAsync(string videoName, long videoSize, string do var responseSessionId = await _uploadVideoTusService.StartAsync(uploadVideoRequest, cancellationToken); if (!responseSessionId.IsSuccess || string.IsNullOrEmpty(responseSessionId.Data)) { - _logger.LogError(new Exception(responseSessionId.Exception.Message), responseSessionId.Json); + _logger.LogError(new Exception(responseSessionId.Exception?.Message), responseSessionId.Json); } return responseSessionId.Data; From f744dcb67bb6686c5a693c54a4506e9482810975 Mon Sep 17 00:00:00 2001 From: ShadyNagy Date: Fri, 20 Dec 2024 17:52:14 +0200 Subject: [PATCH 04/14] - try --- src/DevBetterWeb.Core/Services/CreateVideoService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/DevBetterWeb.Core/Services/CreateVideoService.cs b/src/DevBetterWeb.Core/Services/CreateVideoService.cs index f7fe61344..bf487705c 100644 --- a/src/DevBetterWeb.Core/Services/CreateVideoService.cs +++ b/src/DevBetterWeb.Core/Services/CreateVideoService.cs @@ -45,6 +45,8 @@ public async Task StartAsync(string videoName, long videoSize, string do HideFromVimeo = true }; var responseSessionId = await _uploadVideoTusService.StartAsync(uploadVideoRequest, cancellationToken); + //TODO: Remove this + _logger.LogInformation($"Error Vimeo: {responseSessionId.Json}"); if (!responseSessionId.IsSuccess || string.IsNullOrEmpty(responseSessionId.Data)) { _logger.LogError(new Exception(responseSessionId.Exception?.Message), responseSessionId.Json); From 9ea6bf3871f7d9acd82a1affb91a93c5ff1dccf9 Mon Sep 17 00:00:00 2001 From: ShadyNagy Date: Fri, 20 Dec 2024 18:36:13 +0200 Subject: [PATCH 05/14] - removed fetch --- .../Pages/Admin/Videos/Create.cshtml | 157 +++++++++--------- 1 file changed, 76 insertions(+), 81 deletions(-) diff --git a/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml b/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml index cf731d834..353ab1fbe 100644 --- a/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml +++ b/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml @@ -165,47 +165,39 @@ } }); }); - function startUpload(file, videoName, videoCreationDate) { - const videoSize = file.size; - - const uploadVideoStartRequest = { - videoSize: videoSize, - videoName: videoName, - createdTime: videoCreationDate, - }; - - fetch('/videos/start', { - method: 'POST', - body: JSON.stringify(uploadVideoStartRequest), - headers: { - 'Content-Type': 'application/json' - } - }) - .then(response => { - if (!response.ok) { - document.getElementById('confirmCreate').disabled = false; - throw new Error(`HTTP error! status: ${response.status}`); - } else { - return response.text(); - } - }) - .then(data => { - try { - let jsonData = JSON.parse(data); - uploadChunks(jsonData.sessionId, file, null); - } catch (e) { - document.getElementById('confirmCreate').disabled = false; - console.log("The server's response wasn't valid JSON. It was:", data); - console.log("The server's response wasn't valid JSON. It was:", e); + + function startUpload(file, videoName, videoCreationDate) { + const videoSize = file.size; + + const uploadVideoStartRequest = { + videoSize: videoSize, + videoName: videoName, + createdTime: videoCreationDate, + }; + + $.ajax({ + url: '/videos/start', + type: 'POST', + data: JSON.stringify(uploadVideoStartRequest), + contentType: 'application/json', + success: function (data) { + try { + const jsonData = JSON.parse(data); + uploadChunks(jsonData.sessionId, file, null); + } catch (e) { + document.getElementById('confirmCreate').disabled = false; + console.error("The server's response wasn't valid JSON:", data); + alert("The server's response wasn't valid JSON."); + } + }, + error: function (xhr, status, error) { + document.getElementById('confirmCreate').disabled = false; + console.error('Request failed', status, error); + alert(`HTTP error! status: ${xhr.status}`); + } + }); + } - } - }) - .catch(error => { - document.getElementById('confirmCreate').disabled = false; - console.error('Request failed', error); - alert(error.message); - }); - } function uploadChunks(sessionId, file, folderId) { let offset = 0; @@ -245,48 +237,51 @@ progressBar.setAttribute("aria-valuenow", progress); progressText.innerText = progress + "%"; } + + function uploadChunk(sessionId, chunk, isLastChunk, folderId) { + return new Promise((resolve, reject) => { + const mdFileContentPromise = readMdFilePromise(); + + const reader = new FileReader(); + reader.onload = async function (e) { + const base64Chunk = btoa( + new Uint8Array(e.target.result) + .reduce((data, byte) => data + String.fromCharCode(byte), '') + ); + + let body = { sessionId, chunk: base64Chunk }; + if (folderId !== null) { + body.folderId = folderId; + } + if (isLastChunk) { + const mdFileContent = await mdFileContentPromise; + body.description = mdFileContent; + } + + $.ajax({ + url: '/videos/upload', + type: 'POST', + data: JSON.stringify(body), + contentType: 'application/json', + success: function (response) { + resolve(response); + }, + error: function (xhr, status, error) { + console.error('Upload chunk failed', status, error); + reject(new Error('Upload chunk failed')); + } + }); + }; + + reader.onerror = function () { + reject(new Error('Failed to read file')); + }; + + + reader.readAsArrayBuffer(chunk); + }); + } - function uploadChunk(sessionId, chunk, isLastChunk, folderId) { - return new Promise((resolve, reject) => { - mdFileContentPromise = readMdFilePromise(); - - const reader = new FileReader(); - reader.onload = async function (e) { - const base64Chunk = btoa( - new Uint8Array(e.target.result) - .reduce((data, byte) => data + String.fromCharCode(byte), '') - ); - let body = { sessionId, chunk: base64Chunk }; - if (folderId !== null) { - body.folderId = folderId; - } - if (isLastChunk) { - const mdFileContent = await mdFileContentPromise; - body.description = mdFileContent; - } - fetch('/videos/upload', { - method: 'POST', - body: JSON.stringify(body), - headers: { - 'Content-Type': 'application/json' - } - }) - .then(response => { - if (!response.ok) { - throw new Error('Upload chunk failed'); - } - resolve(response.json()); - }) - .catch(reject); - }; - - reader.onerror = function () { - reject(new Error('Failed to read file')); - }; - - reader.readAsArrayBuffer(chunk); - }); - } function updateMdPreview(descriptionContent) { var converter = new showdown.Converter(); From f582e4cab357dbc367fca6edab9cbb3bc5ac33fd Mon Sep 17 00:00:00 2001 From: ShadyNagy Date: Fri, 20 Dec 2024 18:59:06 +0200 Subject: [PATCH 06/14] - fix --- .../Pages/Admin/Videos/Create.cshtml | 78 ++++++++++--------- ...g~f19ee8c3400f98bb3eb9977df0c24b3ae0b438c0 | 23 ------ 2 files changed, 43 insertions(+), 58 deletions(-) delete mode 100644 src/DevBetterWeb.Web/web.config~f19ee8c3400f98bb3eb9977df0c24b3ae0b438c0 diff --git a/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml b/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml index 353ab1fbe..a81c4208b 100644 --- a/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml +++ b/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml @@ -165,7 +165,7 @@ } }); }); - + function startUpload(file, videoName, videoCreationDate) { const videoSize = file.size; @@ -175,28 +175,38 @@ createdTime: videoCreationDate, }; - $.ajax({ - url: '/videos/start', - type: 'POST', - data: JSON.stringify(uploadVideoStartRequest), - contentType: 'application/json', - success: function (data) { + fetch('/videos/start', { + method: 'POST', + body: JSON.stringify(uploadVideoStartRequest), + headers: { + 'Content-Type': 'application/json' + } + }) + .then(response => { + if (!response.ok) { + document.getElementById('confirmCreate').disabled = false; + throw new Error(HTTP error! status: ${response.status}); + } else { + return response.text(); + } + }) + .then(data => { try { - const jsonData = JSON.parse(data); + let jsonData = JSON.parse(data); uploadChunks(jsonData.sessionId, file, null); } catch (e) { document.getElementById('confirmCreate').disabled = false; - console.error("The server's response wasn't valid JSON:", data); - alert("The server's response wasn't valid JSON."); + console.log("The server's response wasn't valid JSON. It was:", data); + console.log("The server's response wasn't valid JSON. It was:", e); + } - }, - error: function (xhr, status, error) { + }) + .catch(error => { document.getElementById('confirmCreate').disabled = false; - console.error('Request failed', status, error); - alert(`HTTP error! status: ${xhr.status}`); - } - }); - } + console.error('Request failed', error); + alert(error.message); + }); + } function uploadChunks(sessionId, file, folderId) { @@ -237,10 +247,10 @@ progressBar.setAttribute("aria-valuenow", progress); progressText.innerText = progress + "%"; } - + function uploadChunk(sessionId, chunk, isLastChunk, folderId) { return new Promise((resolve, reject) => { - const mdFileContentPromise = readMdFilePromise(); + mdFileContentPromise = readMdFilePromise(); const reader = new FileReader(); reader.onload = async function (e) { @@ -248,7 +258,6 @@ new Uint8Array(e.target.result) .reduce((data, byte) => data + String.fromCharCode(byte), '') ); - let body = { sessionId, chunk: base64Chunk }; if (folderId !== null) { body.folderId = folderId; @@ -257,30 +266,29 @@ const mdFileContent = await mdFileContentPromise; body.description = mdFileContent; } - - $.ajax({ - url: '/videos/upload', - type: 'POST', - data: JSON.stringify(body), - contentType: 'application/json', - success: function (response) { - resolve(response); - }, - error: function (xhr, status, error) { - console.error('Upload chunk failed', status, error); - reject(new Error('Upload chunk failed')); + fetch('/videos/upload', { + method: 'POST', + body: JSON.stringify(body), + headers: { + 'Content-Type': 'application/json' } - }); + }) + .then(response => { + if (!response.ok) { + throw new Error('Upload chunk failed'); + } + resolve(response.json()); + }) + .catch(reject); }; reader.onerror = function () { reject(new Error('Failed to read file')); }; - reader.readAsArrayBuffer(chunk); }); - } + } function updateMdPreview(descriptionContent) { diff --git a/src/DevBetterWeb.Web/web.config~f19ee8c3400f98bb3eb9977df0c24b3ae0b438c0 b/src/DevBetterWeb.Web/web.config~f19ee8c3400f98bb3eb9977df0c24b3ae0b438c0 deleted file mode 100644 index 2e6d7f8ae..000000000 --- a/src/DevBetterWeb.Web/web.config~f19ee8c3400f98bb3eb9977df0c24b3ae0b438c0 +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - From 503e45a0a9f1c3e5eba0a319cc47a24047531fd3 Mon Sep 17 00:00:00 2001 From: ShadyNagy Date: Fri, 20 Dec 2024 19:26:36 +0200 Subject: [PATCH 07/14] fix --- .../Pages/Admin/Videos/Create.cshtml | 365 +++++++++--------- 1 file changed, 181 insertions(+), 184 deletions(-) diff --git a/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml b/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml index a81c4208b..dddcaa2d3 100644 --- a/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml +++ b/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml @@ -2,21 +2,21 @@ @model DevBetterWeb.Web.Pages.Admin.Videos.CreateModel @{ - ViewData["Title"] = "Create"; + ViewData["Title"] = "Create"; } @@ -25,35 +25,35 @@
-
-
-
- - - -
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
- - -
-
-
+
+
+
+ + + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
@@ -71,30 +71,30 @@
-
-
-
-
-
- - 0% - -
-
-
-
-
-
- -
-
-
+
+
+
+
+
+ + 0% + +
+
+
+
+
+
+ +
+
+
@section Scripts { @@ -103,70 +103,69 @@ } -} + +} \ No newline at end of file From 0f006ca82f814a16af11798ef4303301774c5cee Mon Sep 17 00:00:00 2001 From: ShadyNagy Date: Fri, 20 Dec 2024 19:45:05 +0200 Subject: [PATCH 08/14] fix --- src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml b/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml index dddcaa2d3..d42c70dd6 100644 --- a/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml +++ b/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml @@ -178,7 +178,8 @@ method: 'POST', body: JSON.stringify(uploadVideoStartRequest), headers: { - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', + 'RequestVerificationToken': document.querySelector('input[name="__RequestVerificationToken"]').value } }) .then(response => { @@ -268,7 +269,8 @@ method: 'POST', body: JSON.stringify(body), headers: { - 'Content-Type': 'application/json' + 'Content-Type': 'application/json', + 'RequestVerificationToken': document.querySelector('input[name="__RequestVerificationToken"]').value } }) .then(response => { From dd531d1a51668bf778b80f515b764581f11cf5d7 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Fri, 20 Dec 2024 13:26:52 -0500 Subject: [PATCH 09/14] Add logging --- global.json | 2 +- .../Endpoints/VideoEndpoints/UploadVideoStartEndpoint.cs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 9e0754e57..9ff1a348c 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.0", + "version": "8.*", "rollForward": "latestFeature" } } \ No newline at end of file diff --git a/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadVideoStartEndpoint.cs b/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadVideoStartEndpoint.cs index 283bcc104..aa4489ecd 100644 --- a/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadVideoStartEndpoint.cs +++ b/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadVideoStartEndpoint.cs @@ -14,15 +14,19 @@ public class UploadVideoStartEndpoint : EndpointBaseAsync .WithResult> { private readonly ICreateVideoService _createVideo; + private readonly IAppLogger _logger; - public UploadVideoStartEndpoint(ICreateVideoService createVideo) + public UploadVideoStartEndpoint(ICreateVideoService createVideo, + IAppLogger logger) { _createVideo = createVideo; + _logger = logger; } [HttpPost("videos/start")] public override async Task> HandleAsync([FromBody] UploadVideoStartRequest request, CancellationToken cancellationToken = default) { + _logger.LogWarning("HandleAsync called for videos/start"); string domain = HttpContext.Request.Host.Value; var sessionId = await _createVideo.StartAsync(request.VideoName, request.VideoSize, domain, cancellationToken); From 2ddb440803af7b8a830a93934166091a68a2ca79 Mon Sep 17 00:00:00 2001 From: ShadyNagy Date: Fri, 20 Dec 2024 21:14:33 +0200 Subject: [PATCH 10/14] fix --- src/DevBetterWeb.Web/Program.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/DevBetterWeb.Web/Program.cs b/src/DevBetterWeb.Web/Program.cs index f0af55f22..fae1f336e 100644 --- a/src/DevBetterWeb.Web/Program.cs +++ b/src/DevBetterWeb.Web/Program.cs @@ -175,7 +175,7 @@ } app.UseHttpsRedirection(); -app.UseStaticFiles(); + //app.UseCookiePolicy(); app.UseRouting(); @@ -195,6 +195,8 @@ app.MapRazorPages(); app.MapDefaultControllerRoute(); +app.UseStaticFiles(); + // seed database await ApplyLocalMigrationsAsync(app); await SeedDatabase(app); From ba3efa5435f4565ff73daefe3a5ded642d0aa40e Mon Sep 17 00:00:00 2001 From: Sarah Dutkiewicz Date: Fri, 20 Dec 2024 15:30:35 -0500 Subject: [PATCH 11/14] Update CI/CD to push to a Linux web app (#1346) --- .github/workflows/ci-cd.yml | 4 ++-- .github/workflows/dotnetcore.yml | 2 +- .github/workflows/publish.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 27497976c..b0a1d4db7 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -12,7 +12,7 @@ jobs: name: Continuous Integration strategy: matrix: - os: [ ubuntu-latest, windows-latest ] + os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} outputs: is_push_to_default_branch: ${{ steps.conditionals_handler.outputs.is_push_to_default_branch }} @@ -104,7 +104,7 @@ jobs: if: needs.ci.outputs.is_push_to_default_branch == 'true' name: Continuous Deployment needs: ci - runs-on: windows-latest + runs-on: ubuntu-latest steps: - name: Download publish artifacts id: dl_publish_artifacts diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 3b1ebd9fe..707f06b0b 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -5,7 +5,7 @@ on: [pull_request, workflow_dispatch] jobs: build: - runs-on: windows-latest + runs-on: ubuntu-latest env: VIMEO_TOKEN: ${{ secrets.VIMEO_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a722e1427..7aa6cdecd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,7 +1,7 @@ name: publish env: - AZURE_WEBAPP_NAME: devBetter + AZURE_WEBAPP_NAME: devbetter-linux AZURE_GROUP_NAME: DevBetterGroup AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root @@ -12,7 +12,7 @@ on: jobs: build-and-deploy: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 5677e7804e48b55a7066ebae722894c75af3dc21 Mon Sep 17 00:00:00 2001 From: Sarah Dutkiewicz Date: Fri, 20 Dec 2024 15:41:37 -0500 Subject: [PATCH 12/14] fixing AZURE_WEBAPP_NAME in ci-cd.yml --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index b0a1d4db7..aa32699cf 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -3,7 +3,7 @@ name: CI/CD Pipeline on: [ push, pull_request, workflow_dispatch ] env: - AZURE_WEBAPP_NAME: devBetter + AZURE_WEBAPP_NAME: devbetter-linux AZURE_GROUP_NAME: DevBetterGroup AZURE_WEBAPP_PACKAGE_PATH: '.' From 97929cc4d6a701d0a4b902e0d529361ace5fca24 Mon Sep 17 00:00:00 2001 From: ShadyNagy Date: Mon, 23 Dec 2024 17:35:33 +0200 Subject: [PATCH 13/14] - Api is added. --- Directory.Packages.props | 1 + src/DevBetterWeb.Web/DevBetterWeb.Web.csproj | 1 + .../Endpoints/VideoEndpoints/UploadChunkEndpoint.cs | 2 +- .../Endpoints/VideoEndpoints/UploadVideoStartEndpoint.cs | 2 +- src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml | 4 ++-- src/DevBetterWeb.Web/Program.cs | 4 +++- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index d733217c9..49736d2fa 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -62,6 +62,7 @@ + diff --git a/src/DevBetterWeb.Web/DevBetterWeb.Web.csproj b/src/DevBetterWeb.Web/DevBetterWeb.Web.csproj index 20343cabe..813e6a3b5 100644 --- a/src/DevBetterWeb.Web/DevBetterWeb.Web.csproj +++ b/src/DevBetterWeb.Web/DevBetterWeb.Web.csproj @@ -48,6 +48,7 @@ + diff --git a/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadChunkEndpoint.cs b/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadChunkEndpoint.cs index 5833036b1..c8628d9d6 100644 --- a/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadChunkEndpoint.cs +++ b/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadChunkEndpoint.cs @@ -25,7 +25,7 @@ public UploadChunkEndpoint(ICreateVideoService createVideo, VimeoSettings vimeoS _vimeoSettings = vimeoSettings; } - [HttpPost("videos/upload")] + [HttpPost("api/videos/upload")] public override async Task> HandleAsync([FromBody] UploadChunkRequest uploadChunkRequest, CancellationToken cancellationToken = default) { if (uploadChunkRequest.Chunk.Length <= 0) diff --git a/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadVideoStartEndpoint.cs b/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadVideoStartEndpoint.cs index aa4489ecd..748e6c95f 100644 --- a/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadVideoStartEndpoint.cs +++ b/src/DevBetterWeb.Web/Endpoints/VideoEndpoints/UploadVideoStartEndpoint.cs @@ -23,7 +23,7 @@ public UploadVideoStartEndpoint(ICreateVideoService createVideo, _logger = logger; } - [HttpPost("videos/start")] + [HttpPost("api/videos/start")] public override async Task> HandleAsync([FromBody] UploadVideoStartRequest request, CancellationToken cancellationToken = default) { _logger.LogWarning("HandleAsync called for videos/start"); diff --git a/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml b/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml index d42c70dd6..ba696d2d5 100644 --- a/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml +++ b/src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml @@ -174,7 +174,7 @@ createdTime: videoCreationDate, }; - fetch('/videos/start', { + fetch('/api/videos/start', { method: 'POST', body: JSON.stringify(uploadVideoStartRequest), headers: { @@ -265,7 +265,7 @@ const mdFileContent = await mdFileContentPromise; body.description = mdFileContent; } - fetch('/videos/upload', { + fetch('/api/videos/upload', { method: 'POST', body: JSON.stringify(body), headers: { diff --git a/src/DevBetterWeb.Web/Program.cs b/src/DevBetterWeb.Web/Program.cs index fae1f336e..b8550a023 100644 --- a/src/DevBetterWeb.Web/Program.cs +++ b/src/DevBetterWeb.Web/Program.cs @@ -193,9 +193,11 @@ } app.MapRazorPages(); -app.MapDefaultControllerRoute(); app.UseStaticFiles(); +app.MapDefaultControllerRoute(); + + // seed database await ApplyLocalMigrationsAsync(app); From 7a574c6bd6b5567715d35e755b2ae491791d0cd2 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Mon, 23 Dec 2024 21:38:46 -0500 Subject: [PATCH 14/14] Update README.md (#1349) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index acc360712..184cc6dbe 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A web application for devBetter.com, a developer coaching program web site and a ## What is devBetter? -Head over to [devBetter.com](https://devbetter.com) to see the live site. Scroll through the home page and read the testimonials. Essentially devBetter is a group dedicated to improving professional software developers of all stripes. We have a virtual community (currently using Discord) and we meet for live group Q&A sessions about once a week (currently using Zoom). We challenge and promote one another, answer tough code and software design questions, work through exercises, and more. This site is used as a playground by some members and its owner, Steve, to provide a real, working example of some of the coding techniques and practices we discuss. This is in contrast to labs, katas, and exercises that, while also valuable, are not the same as solving real world problems with real software in a production environment. +Head over to [devBetter.com](https://devbetter.com) to see the live site. Scroll through the home page and read the testimonials. Essentially devBetter is a group dedicated to improving professional software developers of all stripes. We have a virtual community (currently using Discord) and we meet for live group Q&A sessions about once a week (currently using Zoom). We challenge and promote one another, answer tough code and software design questions, work through exercises, and more. This site is used as a playground by some members and its owner, ardalis, to provide a real, working example of some of the coding techniques and practices we discuss. This is in contrast to labs, katas, and exercises that, while also valuable, are not the same as solving real world problems with real software in a production environment. ## Features