Serving Front-end Flags
private readonly IFeatureManagerSnapshot _featureSnapshotManager;
public HomeController(IFeatureManagerSnapshot featureSnapshotManager)
{
_featureSnapshotManager = featureSnapshotManager;
}
[Route("flags.json")]
public async Task<IActionResult> FeatureFlags()
{
var model = new Dictionary<string, bool>();
await foreach (var name in _featureSnapshotManager.GetFeatureNamesAsync())
model.Add(name, await _featureSnapshotManager.IsEnabledAsync(name));
return Ok(model);
}Last updated