Skip to content

GWP Minimal API and Razor Pages hosting samples#172

Open
alafleur-genetec wants to merge 6 commits intomainfrom
feat/gwp-web-samples
Open

GWP Minimal API and Razor Pages hosting samples#172
alafleur-genetec wants to merge 6 commits intomainfrom
feat/gwp-web-samples

Conversation

@alafleur-genetec
Copy link
Copy Markdown
Member

No description provided.

Two ASP.NET Core samples demonstrating server-side token proxy
patterns for hosting the Genetec Web Player:

- GwpMinimalApiSample: single Program.cs with static HTML page
- GwpRazorPagesSample: Razor Pages with per-request CSP nonces
  and server-rendered configuration via JsonSerializer.Serialize

Both samples include proper player lifecycle cleanup on failed
start and cancellable startup with generation tracking.
The limitation is that the application itself has no user
authentication, not just the token endpoint.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two new ASP.NET Core hosting samples for Genetec Web Player (GWP): a Minimal API static-site sample and a Razor Pages sample that demonstrates per-request CSP nonces while proxying Media Gateway token requests server-side.

Changes:

  • Introduces GwpMinimalApiSample (static index.html + /api/config and /api/token/{cameraId} endpoints).
  • Introduces GwpRazorPagesSample (Razor page with server-rendered config + CSP nonce middleware + /api/token/{cameraId} endpoint).
  • Adds sample documentation and local debug profiles (launchSettings.json) for both.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Samples/Genetec Web Player/GwpRazorPagesSample/README.md Documents the Razor Pages hosting approach, CSP nonce flow, and environment requirements.
Samples/Genetec Web Player/GwpRazorPagesSample/Properties/launchSettings.json Adds local debug profile and ports for the Razor Pages sample.
Samples/Genetec Web Player/GwpRazorPagesSample/Program.cs Implements CSP nonce middleware, Media Gateway HttpClient, Razor Pages hosting, and token proxy endpoint.
Samples/Genetec Web Player/GwpRazorPagesSample/Pages/Index.cshtml.cs Supplies server-rendered config and CSP nonce to the Razor page.
Samples/Genetec Web Player/GwpRazorPagesSample/Pages/Index.cshtml Provides the GWP UI and client logic (including dynamic gwp.js loading).
Samples/Genetec Web Player/GwpRazorPagesSample/GwpRazorPagesSample.csproj Adds new net8.0 Razor Pages sample project.
Samples/Genetec Web Player/GwpRazorPagesSample/appsettings.json Adds Media Gateway configuration for the Razor Pages sample.
Samples/Genetec Web Player/GwpMinimalApiSample/wwwroot/index.html Provides the Minimal API sample UI and client logic, including CSP via meta tag.
Samples/Genetec Web Player/GwpMinimalApiSample/README.md Documents the Minimal API hosting approach and environment requirements.
Samples/Genetec Web Player/GwpMinimalApiSample/Properties/launchSettings.json Adds local debug profile and ports for the Minimal API sample.
Samples/Genetec Web Player/GwpMinimalApiSample/Program.cs Implements Minimal API hosting, Media Gateway HttpClient, config endpoint, and token proxy endpoint.
Samples/Genetec Web Player/GwpMinimalApiSample/GwpMinimalApiSample.csproj Adds new net8.0 Minimal API sample project.
Samples/Genetec Web Player/GwpMinimalApiSample/appsettings.json Adds Media Gateway configuration for the Minimal API sample.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Samples/Genetec Web Player/GwpRazorPagesSample/Program.cs
Comment thread Samples/Genetec Web Player/GwpRazorPagesSample/Pages/Index.cshtml
Comment thread Samples/Genetec Web Player/GwpMinimalApiSample/wwwroot/index.html
Comment thread Samples/Genetec Web Player/GwpMinimalApiSample/README.md
Comment thread Samples/Genetec Web Player/GwpRazorPagesSample/README.md Outdated
Comment thread Samples/Genetec Web Player/GwpMinimalApiSample/README.md Outdated
Comment thread Samples/Genetec Web Player/GwpRazorPagesSample/README.md
alafleur-genetec and others added 4 commits April 2, 2026 16:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants