Skip to content

Tag: node.js

How to generate unique ID with node.js

How to set a variable value with database query callback? How I can do it? Answer It’s been some time since I used node.js, but I think I might be able to help. Firstly, in node, you only have a single thread and are supposed to use callbacks. What will happen with your code, is that base.getID query wi…

Unable to run node app.js file

I am learning node.js and I am trying to run the app.js file using the command node app.js but the bash returns nothing (no errors either). Here are the steps I followed: $ brew install node $ sudo npm install -g express $ sudo npm install -g express-generator after i get into a new folder I created I run $

How to create a simple http proxy in node.js?

I’m trying to create a proxy server to pass HTTP GET requests from a client to a third party website (say google). My proxy just needs to mirror incoming requests to their corresponding path on the target site, so if my client’s requested url is: The following resource should be served: Here is wh…