Questions tagged node.js

Explore the latest questions and answers asked by our top developers.

how can i extract the credentials from authorization header in Node js

Angular auth.service.ts login(mobileNumber: number, password: string) { console.log(mobileNumber,password); let headers = new HttpHeaders({‘Content-Type’: ‘application/json’,’Authorization’: ‘Basic ‘+window.btoa(mobileNumber + ‘:’ + password) }); let options = { headers: headers }; return<>("http://localhost:3000/api/user/login",{}, options) } Node js User.js"/login", (req, res, next) => { let user = basicAuth(req); console.log("mobile number is ",; }); Error Message : TypeError: Cannot […]

By suriyan
Categorized as angular, node.js Tagged ,

How to send data from to AngularJS front-end

I have the following AngularJS code: var app = angular.module(‘List’, []); app.controller(‘listCtrl’,function($scope){ $scope.tasks = ["Learn Angular JS", "Build AngularJS application","Submit Xanadu Application"]; $scope.dTasks = []; $scope.addTask = function() { $scope.tasks.push($scope.addMe); }; $scope.removeTask = function(x) { $scope.dTasks.push($scope.tasks[x]); $scope.tasks.splice(x,1); }; $scope.editTask = function(x) { console.log(x, $scope.tasks[x]); $scope.tasks[x] = prompt("Edit Task", $scope.tasks[x]); }; }); I also have a […]

By quanticbolt
Categorized as angularjs, database, node.js, postgresql Tagged , , ,

i cant install angular linux

npm WARN EBADENGINE Unsupported engine { package: ‘@angular/[email protected]’, npm WARN EBADENGINE required: npm WARN EBADENGINE { node: ‘^12.14.1 || >=14.0.0’, npm WARN EBADENGINE npm: ‘^6.11.0 || ^7.5.6’, npm WARN EBADENGINE yarn: ‘>= 1.13.0’ }, npm WARN EBADENGINE current: { node: ‘v10.19.0’, npm: ‘7.22.0’ } } npm WARN EBADENGINE Unsupported engine { package: ‘@angular-devkit/[email protected]’, npm WARN […]

By Saif Marzougua
Categorized as angular, node.js, npm Tagged , ,

Node.js Websocket don’t work on hosting server

I’m trying to make Angular application with API in Node.JS. On my local machine everything works well but when I’m push API to remote server I’m getting error from WebSocket: WebSocket connection to <URL> failed: WebSocket is closed before the connection is established. There is no place when I use ws.close() so I think that […]

By Ravn
Categorized as angular, hosting, node.js,, websocket Tagged , , , ,

Old token values is getting retained in connection call

I have a client application in Angular and Backend service in nodejs. Im using I pass the authorization token to jwt.verify on below code io.on(‘connection’, socket => { jwt.verify(authorization, SECRET, (tokenError, decode) => { if(tokenError){ socket.emit(‘myError’,{errorMessage:’Authorization failed’}) } else { //My custom logic } }}); From the client Im making call to this service […]

Categorized as angular, node.js, Tagged , ,

Best way to store auth token in angular app

My angular app connects to an AdonisJS rest api thatrequires an auth token to work. This token is generated on succesful login however storing it for future requests is a problem. Ive tried to use window.sessionStorage but unfortunately this remains undefined until the user refreshes the page. Which means my angular app doesent get the […]

ReferenceError: window is not defined while running serve:ssr

Whenever I try to build it works fine. But when I try to serve:ssr it throws error saying window not defined. I read various post and stack regarding same and followed all the instruction still not able to get it worknig. I am using angular version 12.0.1 I run these command simultanously. npm run build:ssr […]

By Santosh
Categorized as angular, node.js, server-side-rendering Tagged , ,

Access text box field and fill it with custom string

I have a website( which im not owner of) which has a text box with Id = "idName". I have written a javascript function which has to fill the text box with my custom string : function task() { //Below is my webpage which has a textbox with id = "idName" var popup =""); […]

By Mr Curious
Categorized as angularjs, java, javascript, node.js Tagged , , ,

ng build frozen on live ubuntu server

Im trying to ng build the source of an angular app in the www directory of apache on a live ububtu server hosted on digital oceon. The command gets to compiling @angular/core: es2015 as esm2015 And gets stuck there till kingdom come. This app is building very well on my local windows machine. Im not […]

By Noble Eugene
Categorized as angular, node.js, ubuntu Tagged , ,

If same value is selected add +1 to second drop down

If same value is selected add +1 to second drop down and save in database – I have two dropdown enrollment_year and leaving_year. Let say if 2021 is selected in both the dropdown then leaving year should automatically get saved as 2022 in mysql database. years_array is a array which has value From [1967 – […]

By anuj todankar
Categorized as angular, express, mysql, node.js, typescript Tagged , , , ,
1 2 3 247

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us