-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable commented code and add missing imports
- Loading branch information
Showing
2 changed files
with
42 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,38 @@ | ||
// namespace Argon.Api.Controllers; | ||
// | ||
// using Microsoft.AspNetCore.Authorization; | ||
// using Microsoft.AspNetCore.Mvc; | ||
// | ||
// [ApiController] | ||
// public class MetadataController : ControllerBase | ||
// { | ||
// [Route("/cfg.json")] | ||
// [AllowAnonymous] | ||
// public ValueTask<HeadRoutingConfig> GetHead() | ||
// { | ||
// return new ValueTask<HeadRoutingConfig>(new HeadRoutingConfig( | ||
// $"{GlobalVersion.FullSemVer}.{GlobalVersion.ShortSha}", | ||
// "api.argon.gl", | ||
// "argon-f14ic5ia.livekit.cloud", | ||
// [ | ||
// new RegionalNode("cdn-ru1.argon.gl", "ru1"), | ||
// new RegionalNode("cdn-ru2.argon.gl", "ru1"), | ||
// new RegionalNode("cdn-as1.argon.gl", "as1") | ||
// ], [ | ||
// new FeatureFlag("dev.window", true), | ||
// new FeatureFlag("user.allowServerCreation", true) | ||
// ])); | ||
// } | ||
// } | ||
// | ||
// public record HeadRoutingConfig( | ||
// string version, | ||
// string masterEndpoint, | ||
// string webRtcEndpoint, | ||
// List<RegionalNode> cdnAddresses, | ||
// List<FeatureFlag> features | ||
// ); | ||
// | ||
// public record RegionalNode(string url, string code); | ||
// | ||
// public record FeatureFlag(string code, bool enabled); | ||
namespace Argon.Api.Controllers; | ||
|
||
using Microsoft.AspNetCore.Authorization; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
[ApiController] | ||
public class MetadataController : ControllerBase | ||
{ | ||
[Route("/cfg.json")] | ||
[AllowAnonymous] | ||
public ValueTask<HeadRoutingConfig> GetHead() | ||
{ | ||
return new ValueTask<HeadRoutingConfig>(new HeadRoutingConfig( | ||
$"{GlobalVersion.FullSemVer}.{GlobalVersion.ShortSha}", | ||
"api.argon.gl", | ||
"argon-f14ic5ia.livekit.cloud", | ||
[ | ||
new RegionalNode("cdn-ru1.argon.gl", "ru1"), | ||
new RegionalNode("cdn-ru2.argon.gl", "ru1"), | ||
new RegionalNode("cdn-as1.argon.gl", "as1") | ||
], [ | ||
new FeatureFlag("dev.window", true), | ||
new FeatureFlag("user.allowServerCreation", true) | ||
])); | ||
} | ||
} | ||
|
||
public record HeadRoutingConfig( | ||
string version, | ||
string masterEndpoint, | ||
string webRtcEndpoint, | ||
List<RegionalNode> cdnAddresses, | ||
List<FeatureFlag> features | ||
); | ||
|
||
public record RegionalNode(string url, string code); | ||
|
||
public record FeatureFlag(string code, bool enabled); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters