Updated NavdataModel and RouteController to user environment Variables

This commit is contained in:
Luke Else 2022-02-09 20:41:39 +00:00
parent 30ac25c8fb
commit 39c18ee9bf
2 changed files with 4 additions and 2 deletions

View File

@ -132,7 +132,8 @@ namespace EFB.Controllers
headerData.Add("referer", "luke-else.co.uk");
Dictionary<string, string> formData = new Dictionary<string, string>();
formData.Add("token", "");
formData.Add("token", Environment.GetEnvironmentVariable("ChartFoxAPIKey", EnvironmentVariableTarget.User));
var body = new FormUrlEncodedContent(formData);
//make Charts request

View File

@ -39,7 +39,8 @@ namespace EFB.Models
}
public static async Task<NavdataModel[]> Populate(){
MySqlConnection con = new MySqlConnection("server=server.luke-else.co.uk;userid=root;password=;database=EFB");
string password = Environment.GetEnvironmentVariable("MySQLPassword", EnvironmentVariableTarget.User);
MySqlConnection con = new MySqlConnection($"server=server.luke-else.co.uk;userid=root;password={password};database=EFB");
con.Open();
// Console.WriteLine($"MySQL version : {con.ServerVersion}");