ERROR ReferenceError: Headers is not defined
when i run the command node dist/server.js it says that Node server listening on http://localhost:4000. but when i load http://localhost:4000 in the browser, the Headers is not defined error comes
ERROR ReferenceError: Headers is not defined
when i run the command node dist/server.js it says that Node server listening on http://localhost:4000. but when i load http://localhost:4000 in the browser, the Headers is not defined error comes
You need to provide a request to your browser code
...
// the Request object only lives on the server
export function getRequest(): any {
return { headers: { cookie: document.cookie } };
}
...
providers: [
{
// The server provides these in main.server
provide: REQUEST,
useFactory: getRequest,
},
{ provide: 'ORIGIN_URL', useValue: location.origin },
],