summary refs log tree commit diff
path: root/Rhea/Controllers/NarController.cs
blob: 7ba44ba7ff4e45eaa3bcee5aa724619a8e993164 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using Microsoft.AspNetCore.Mvc;

namespace Rhea.Controllers;

[ApiController]
public class NarController(RheaConfiguration cfg, StoreMetaService storeSvc) : ControllerBase
{
    [HttpHead("/nar/{hash}.nar.zst")]
    public async Task CheckNixNarExists(string hash)
    {
        var path = await storeSvc.GetStorePathByBaseName(hash);
        Response.StatusCode = string.IsNullOrWhiteSpace(path) ? 404 : 200;
    }
    
    [HttpGet("/nar/{hash}.nar.zst")]
    public async Task<string> GetNixCacheInfo()
    {
        return "";
    }
}