Trying to deploy my website to Azure, Signalr gives the following errors on the browser:
Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
For this call:
hubs/presence/negotiate?negotiateVersion=1:1
Followed by:
Error: Failed to complete negotiation with the server: Error: The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.: Status code '405'
Here are the endpoints:
app
.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapHub<PresenceHub>("hubs/presence");
});
The website works on https, and the urls are defined as follows:
export const environment = {
production: true,
apiUrl:'https://vidcallme.azurewebsites.net/api/',
hubUrl:'https://vidcallme.com/hubs/',
baseUrl:'/'
};
The api works, the hub doesn't.
Here's the Api web.config
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\API.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
The client is written with Angular
Related: SignalR Error 405 (method not allowed) - Negotiate.
I'm Using .net Core 5.0