Skip to content

Commit

Permalink
common: simplify compatibility version
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Aug 7, 2024
1 parent e324b58 commit dfabfcb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
1 change: 1 addition & 0 deletions Streetwriters.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace Streetwriters.Common
{
public class Constants
{
public static int COMPATIBILITY_VERSION = 1;
public static bool IS_SELF_HOSTED => Environment.GetEnvironmentVariable("SELF_HOSTED") == "1";
public static bool DISABLE_ACCOUNT_CREATION => Environment.GetEnvironmentVariable("DISABLE_ACCOUNT_CREATION") == "1";
public static string INSTANCE_NAME => Environment.GetEnvironmentVariable("INSTANCE_NAME") ?? "default";
Expand Down
4 changes: 2 additions & 2 deletions Streetwriters.Common/Extensions/AppBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public static IApplicationBuilder UseVersion(this IApplicationBuilder app, Serve
app.Run(async context =>
{
context.Response.ContentType = "application/json";
var data = new Dictionary<string, string>
var data = new Dictionary<string, object>
{
{ "version", Version.AsString() },
{ "version", Constants.COMPATIBILITY_VERSION },
{ "id", server.Id },
{ "instance", Constants.INSTANCE_NAME }
};
Expand Down
32 changes: 0 additions & 32 deletions Streetwriters.Common/Version.cs

This file was deleted.

0 comments on commit dfabfcb

Please sign in to comment.