Skip to content

Commit

Permalink
.net env is wierd
Browse files Browse the repository at this point in the history
  • Loading branch information
EarliestFall988 committed Nov 18, 2023
1 parent 2e4fba7 commit 25b9e53
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,23 @@

var builder = WebApplication.CreateBuilder(args);

var appsetting = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.Build();

// Add services to the container.
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var app = builder.Build();

var apiKey = Environment.GetEnvironmentVariable("API_KEY");
var apiKey = appsetting["API_KEY"];
var valkApiKey = "some key";

Debug.WriteLine("\napi key: " + apiKey + "\n");


long minuteCountWaitTime = 5;
StateMachinesController? stateMachinesController = new StateMachinesController(minuteCountWaitTime);
Expand All @@ -43,6 +50,7 @@

app.MapGet("/", (HttpContext ctx) =>
{
ctx.Response.Headers.Add("Content-Type", "application/json");
ctx.Response.StatusCode = 200;
return JsonSerializer.Serialize(new message("Hello World!"));
});
Expand Down

0 comments on commit 25b9e53

Please sign in to comment.