Removed Immediate.Apis, Added AOT Testing Scripts.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Htmx.ApiDemo.Templates;
|
||||
|
||||
namespace Htmx.ApiDemo;
|
||||
|
||||
public static partial class RouteMap
|
||||
{
|
||||
public static void MapGetIndex(WebApplication app)
|
||||
=> app.MapGet("/", (IHttpContextAccessor contextAccessor) =>
|
||||
{
|
||||
var context = contextAccessor.HttpContext
|
||||
?? throw new InvalidOperationException("HttpContext is not available.");
|
||||
|
||||
var greet = new Greeting { Username = "Enciphered", Count = 0, GreetingId = Guid.NewGuid() };
|
||||
greet.HtmxAwareWriteToBody(
|
||||
context: context,
|
||||
title: "Home",
|
||||
appName: "HtmxApp",
|
||||
pageTitle: "Home"
|
||||
);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user