This commit is contained in:
2026-08-04 06:17:32 +03:00
parent 53f9819d40
commit 2028db671f
19 changed files with 159 additions and 45 deletions
+5 -2
View File
@@ -14,12 +14,15 @@ internal class Program
private static async Task Main(string[] args)
{
var epPort = ushort.Parse(
Environment.GetEnvironmentVariable("ESIUR_PORT")
?? throw new InvalidOperationException("Set ESIUR_PORT before starting the example."));
var wh = new Warehouse();
// Create a store to keep objects.
var system = await wh.Put("sys", new MemoryStore());
// Create a distibuted server
var esiurServer = await wh.Put("sys/server", new EpServer());
var esiurServer = await wh.Put("sys/server", new EpServer() { Port = epPort });
// Add your object to the store
var service = await wh.Put("sys/demo", new Demo());
@@ -86,7 +89,7 @@ internal class Program
// Start your server
await wh.Open();
Console.WriteLine("Running on http://localhost:8888");
Console.WriteLine($"Running on http://localhost:8888/?epPort={epPort}");
}
}
+4 -1
View File
@@ -1,7 +1,10 @@
async function init() {
try {
const epPort = new URLSearchParams(window.location.search).get("epPort");
if (!epPort)
throw new Error("Open this example with the application-defined epPort query parameter.");
connection = await wh.get(`ep://${window.location.hostname}`, {
connection = await wh.get(`ep://${window.location.hostname}:${epPort}`, {
autoReconnect: true
});