btcpayserver/BTCPayServer/Controllers/StorageController.cs
Andrew Camilleri 58d01738ab
More Options refactoring (#2179)
* More Options refactoring

Continues refactoring config classes to use the propert Options pattern where possible.
DataDirectories and DatabaseOptions are now configured the Options pattern and the BTCPayOptions is now moved alongside the other config setup

* Move COnfigure logic for Options to the Startup
2021-01-06 23:51:13 +09:00

25 lines
638 B
C#

using System.Threading.Tasks;
using BTCPayServer.Storage.Services;
using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Storage
{
[Route("Storage")]
public class StorageController : Controller
{
private readonly FileService _FileService;
public StorageController(FileService fileService)
{
_FileService = fileService;
}
[HttpGet("{fileId}")]
public async Task<IActionResult> GetFile(string fileId)
{
var url = await _FileService.GetFileUrl(Request.GetAbsoluteRootUri(), fileId);
return new RedirectResult(url);
}
}
}