Added AssetService. Added command line handling for assets. Added asset streaming on the client
This commit is contained in:
27
Moonlight.ApiServer/Http/Controllers/AssetsController.cs
Normal file
27
Moonlight.ApiServer/Http/Controllers/AssetsController.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Moonlight.ApiServer.Services;
|
||||
using Moonlight.Shared.Http.Responses.Assets;
|
||||
|
||||
namespace Moonlight.ApiServer.Http.Controllers;
|
||||
|
||||
[ApiController]
|
||||
[Route("api/assets")]
|
||||
public class AssetsController : Controller
|
||||
{
|
||||
private readonly AssetService AssetService;
|
||||
|
||||
public AssetsController(AssetService assetService)
|
||||
{
|
||||
AssetService = assetService;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<FrontendAssetResponse> Get()
|
||||
{
|
||||
return new FrontendAssetResponse()
|
||||
{
|
||||
CssFiles = AssetService.CssFiles.ToArray(),
|
||||
JavascriptFiles = AssetService.JavascriptFiles.ToArray(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user