diff --git a/client/Reader/MainForm.cs b/client/Reader/MainForm.cs index 38fdacb..08acd02 100644 --- a/client/Reader/MainForm.cs +++ b/client/Reader/MainForm.cs @@ -12,8 +12,12 @@ namespace Reader { public partial class MainForm : Form { - private static readonly HttpClient http = new HttpClient(); - private const string ServerUrl = "http://192.168.0.125:5000"; + private static readonly HttpClient http = new HttpClient(); + private static readonly string ServerUrl = System.IO.File.ReadAllText("appsettings.json") + .Replace("\"", "") + .Split(':')[1] + .Replace("/", "") + .Trim(); public MainForm() { diff --git a/client/Writer/MainForm.cs b/client/Writer/MainForm.cs index f812e4c..d96adb8 100644 --- a/client/Writer/MainForm.cs +++ b/client/Writer/MainForm.cs @@ -12,7 +12,11 @@ namespace Writer public partial class MainForm : Form { private static readonly HttpClient http = new HttpClient(); - private const string ServerUrl = " http://192.168.0.125:5000"; + private static readonly string ServerUrl = System.IO.File.ReadAllText("appsettings.json") + .Replace("\"", "") + .Split(':')[1] + .Replace("/", "") + .Trim(); public MainForm() { diff --git a/client/appsettings.json b/client/appsettings.json new file mode 100644 index 0000000..d3297fd --- /dev/null +++ b/client/appsettings.json @@ -0,0 +1,3 @@ +{ + "ServerUrl": "http://192.168.0.125:5000" +}