17 lines
No EOL
489 B
C#
17 lines
No EOL
489 B
C#
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace LiloStitcher;
|
|
|
|
[ApiController]
|
|
[Route( "api/image" )]
|
|
public sealed class LiloController( LiloStitcher stitcher ) : ControllerBase
|
|
{
|
|
[HttpPost]
|
|
[Route( "generate" )]
|
|
[Produces( "image/png" )]
|
|
public async Task<IActionResult> Generate( [FromBody] GenerateRequest payload, CancellationToken ct )
|
|
{
|
|
var png = await stitcher.CreateImageAsync( payload, ct );
|
|
return File( png, "image/png" );
|
|
}
|
|
} |