вторник, 12 августа 2025 г.

FeederA, SignalR, RazorPage,WebApi

https://ask.chadgpt.ru/share/b096f402-dab8-43f7-a67c-4570874b99ac

https://ask.chadgpt.ru/share/4af0d0e5-270b-4b9e-92d4-01f6de54d0a6

FeederA, SignalR, RazorPage,WebApi

D:\VC2508\Feeder\FeederSln\FeederSln.sln

D:\VC2508\Feeder\FeederSln\FeederA\FeederA.csproj

------------

SignalR - does not Work

Three Source to set urls

launchSettings.json
Program.cs

FeederA.http

-----------------

launchSettings.json

{

  "$schema": "https://json.schemastore.org/launchsettings.json",

  "profiles": {

    "http": {

      "commandName": "Project",

      "dotnetRunMessages": true,

      "launchBrowser": false,

      "applicationUrl": "http://localhost:5000",

      "environmentVariables": {

        "ASPNETCORE_ENVIRONMENT": "Development"

      }

    },

    "https": {

      "commandName": "Project",

      "dotnetRunMessages": true,

      "launchBrowser": false,

      "applicationUrl": "https://localhost:5001;http://localhost:5000",

      "environmentVariables": {

        "ASPNETCORE_ENVIRONMENT": "Development"

      }

    }

  }

}

----------------------------------------
Program.cs
---------------------------------------
builder.Services.AddCors(options =>
{
    options.AddPolicy("AllowFrontends", p =>
    p.WithOrigins("https://localhost:5001", "http://localhost:5000")
     .AllowAnyHeader()
     .AllowAnyMethod()
     .AllowCredentials());
});
----------------------------------------
FeederA.http
----------------------------------------
@FeederA_HostAddress = http://localhost:5248

GET {{FeederA_HostAddress}}/weatherforecast/
Accept: application/json
---------------------------------------

Комментариев нет:

Отправить комментарий