Skip to content

Commit

Permalink
- Api is added.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadyNagy committed Dec 23, 2024
1 parent c78abed commit 97929cc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<PackageVersion Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.13" />
<PackageVersion Include="NETStandard.Library" Version="2.0.3" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NimblePros.ApiClient" Version="1.0.11" />
<PackageVersion Include="NimblePros.Vimeo" Version="1.0.10" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="ReportGenerator" Version="5.1.25" />
Expand Down
1 change: 1 addition & 0 deletions src/DevBetterWeb.Web/DevBetterWeb.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
</PackageReference>
<PackageReference Include="Microsoft.Web.LibraryManager.Build" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="NimblePros.ApiClient" />
<PackageReference Include="NimblePros.Vimeo" />
<PackageReference Include="Sendgrid" />
<PackageReference Include="Serilog" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public UploadChunkEndpoint(ICreateVideoService createVideo, VimeoSettings vimeoS
_vimeoSettings = vimeoSettings;
}

[HttpPost("videos/upload")]
[HttpPost("api/videos/upload")]
public override async Task<ActionResult<UploadChunkStatus>> HandleAsync([FromBody] UploadChunkRequest uploadChunkRequest, CancellationToken cancellationToken = default)
{
if (uploadChunkRequest.Chunk.Length <= 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public UploadVideoStartEndpoint(ICreateVideoService createVideo,
_logger = logger;
}

[HttpPost("videos/start")]
[HttpPost("api/videos/start")]
public override async Task<ActionResult<UploadVideoStartResponse>> HandleAsync([FromBody] UploadVideoStartRequest request, CancellationToken cancellationToken = default)
{
_logger.LogWarning("HandleAsync called for videos/start");
Expand Down
4 changes: 2 additions & 2 deletions src/DevBetterWeb.Web/Pages/Admin/Videos/Create.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
createdTime: videoCreationDate,
};
fetch('/videos/start', {
fetch('/api/videos/start', {
method: 'POST',
body: JSON.stringify(uploadVideoStartRequest),
headers: {
Expand Down Expand Up @@ -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: {
Expand Down
4 changes: 3 additions & 1 deletion src/DevBetterWeb.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,11 @@
}

app.MapRazorPages();
app.MapDefaultControllerRoute();

app.UseStaticFiles();
app.MapDefaultControllerRoute();



// seed database
await ApplyLocalMigrationsAsync(app);
Expand Down

0 comments on commit 97929cc

Please sign in to comment.