13 | Sign in with your GitHub account to manage your Todo list.
14 |
15 |
56 | @RenderBody()
57 |
58 |
61 |
62 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/src/TodoApp/Pages/_ViewImports.cshtml:
--------------------------------------------------------------------------------
1 | @using TodoApp;
2 | @using TodoApp.Pages;
3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 |
--------------------------------------------------------------------------------
/src/TodoApp/Pages/_ViewStart.cshtml:
--------------------------------------------------------------------------------
1 | @{
2 | Layout = "_Layout";
3 | }
4 |
--------------------------------------------------------------------------------
/src/TodoApp/Program.cs:
--------------------------------------------------------------------------------
1 | // Copyright (c) Martin Costello, 2021. All rights reserved.
2 | // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
3 |
4 | using Microsoft.AspNetCore.HttpOverrides;
5 | using TodoApp;
6 |
7 | // Create the default web application builder
8 | var builder = WebApplication.CreateBuilder(args);
9 |
10 | // Configure the Todo repository and associated services
11 | builder.Services.AddTodoApi();
12 |
13 | // Add user authentication with GitHub as an external OAuth provider
14 | builder.Services.AddGitHubAuthentication();
15 |
16 | // Add Razor Pages to render the UI
17 | builder.Services.AddRazorPages();
18 |
19 | // Configure OpenAPI documentation for the Todo API
20 | builder.Services.AddOpenApi(options =>
21 | {
22 | options.AddDocumentTransformer((document, _, _) =>
23 | {
24 | document.Info.Title = "Todo API";
25 | document.Info.Version = "v1";
26 | return Task.CompletedTask;
27 | });
28 | });
29 |
30 | if (string.Equals(builder.Configuration["CODESPACES"], "true", StringComparison.OrdinalIgnoreCase))
31 | {
32 | // When running in GitHub Codespaces, X-Forwarded-Host also needs to be set
33 | builder.Services.Configure