Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
chore: updated native internal server creator to reflect the api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
scarletquasar committed Sep 16, 2023
1 parent e7ef920 commit 5685817
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public WebServiceApplication(
_port = port;
_isHttpsEnabled = isHttpsEnabled;

melon.SendInstructions($"Melon.http._apps['{name}']._promises = {{}}");
melon.SendInstructions($"Melon.server._apps['{name}']._promises = {{}}");
}

public void AddEchoes(IWebServiceApplicationEcho[] echoes)
Expand Down
35 changes: 1 addition & 34 deletions projects/native/MelonRuntime.WebServices/Program.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1 @@
var builder = WebApplication.CreateBuilder(args);

// Add services to the container.

var app = builder.Build();

// Configure the HTTP request pipeline.

app.UseHttpsRedirection();

var summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};

app.MapGet("/weatherforecast", () =>
{
var forecast = Enumerable.Range(1, 5).Select(index =>
new WeatherForecast
(
DateTime.Now.AddDays(index),
Random.Shared.Next(-20, 55),
summaries[Random.Shared.Next(summaries.Length)]
))
.ToArray();
return forecast;
});

app.Run();

internal record WeatherForecast(DateTime Date, int TemperatureC, string? Summary)
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
_ = 0;

0 comments on commit 5685817

Please sign in to comment.