I'm receiving POST request to my Angular page, which might look like:
https://www.myangularsite.com/login
"POST /login HTTP/1.1
token: randomstring"
My app module looks like
export const routes: Routes = [
{ path: 'login', component: LoginComponent },
{ path: '', redirectTo: 'login', pathMatch: 'full' },
{ path: '**', redirectTo: 'login', pathMatch: 'full' }
];
@NgModule({
declarations: [
LoginComponent,
AppComponent
],
imports: [
BrowserModule,
HttpClientModule,
RouterModule.forRoot(routes, {errorHandler: errorLogger } )
],
bootstrap: [ AppComponent ]
})
export class AppModule { }
My problem is that Angular application doesn't accept POST method requests, only GET. Page displays
Cannot POST /login
I'm running web server through ng serve. Is it possible to set it up to listen to POST requests? I can't change received request to GET.
Even though it is POST request, it is not a backend call. It is called after authorization (similar from oauth), therefore it should display page after login.