VitalJeevanjot
VitalJeevanjot
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
best wishes
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
you will find i am sure 😄
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
you can manage the routes from there and just use it simply with single line function as Proud (guy in vid) did
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
after event listened on js client
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
e.g. 👆
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
// Create a controller class to handle the REST request:
[ApiController]
[Route("api/messages")]
public class MessagesController : ControllerBase
{
[HttpPost]
public IActionResult SendMessage([FromBody] string message)
{
// Create an instance of the SignalR hub context
var hubContext = HttpContext.RequestServices.GetService<IHubContext<MyHub>>();

// Process the message and prepare the data for the REST response
string responseMessage = ProcessMessage(message);

// Send the response to the connected SignalR clients
hubContext.Clients.All.SendAsync("ReceiveResponse", responseMessage);

// Return an appropriate REST response
return Ok(responseMessage);
}
}
// Create a controller class to handle the REST request:
[ApiController]
[Route("api/messages")]
public class MessagesController : ControllerBase
{
[HttpPost]
public IActionResult SendMessage([FromBody] string message)
{
// Create an instance of the SignalR hub context
var hubContext = HttpContext.RequestServices.GetService<IHubContext<MyHub>>();

// Process the message and prepare the data for the REST response
string responseMessage = ProcessMessage(message);

// Send the response to the connected SignalR clients
hubContext.Clients.All.SendAsync("ReceiveResponse", responseMessage);

// Return an appropriate REST response
return Ok(responseMessage);
}
}
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
yes you will get the idea. I got plenty after watching him and also use chatGPT and maybe you can conduct whole thing in c#
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
the connection building
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
but if you can manage it in node js
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
for front-end
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
it's js
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
try from here
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
no time stamp
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
Your welcome
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
just gave me some idea of how both of the things can be done under single request (can be applied in backend)
75 replies
CC#
Created by Julian on 6/19/2023 in #help
❔ Web Question
75 replies