[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x

Node.js

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Share tech news, updates, or what's on your mind.

Sign up to Post

I am building an node.js based application using the microservices pattern.  I have the individual microservices developer including one that handling registering, authenticating and authorizing users.  I am now ready to add an api gateway and am reviewing Kong along with a few others.  Right now, Kong seems to be the most robust except there are a few items that I need clarity on.  

1) Since I already have a user microservice responsible for user management functionality, how can I make Kong aware to use it to authenticate the user and get the subsequent payload from it to use for building the jwt token?

2) Also, I have several endpoint on my microservices that provide additional get and post functionality, etc. like /lists for returning a json list of items as opposed to get which just return one specific json object.  Do I need to do any additional configuration of Kong to allow for this scenario?
0
Understanding Web Applications
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Hello.  I created a firebase database and I am able to write to it using node.js.  However I don't know how to retrieve the information.  The documentation on Google isn't helping.  I know I have to do something with ref but I don't really know how it works.
0
I have a bunch of complicated node apis deployed on ec2s. What would be the easiest way to make them lambda compliant (by adding handler method) and deploy them on lambda ?
I am looking for some steps and guidance.
Thanks
0
Im a Delphi programmer with som old HTML experience. I want to go JS node and Typescript. Where should i start? What do i need to know before i start with JS node and Typescript or is it just to go?
0
I'm a Node newbie. Though was very good at VBScript Classic ASP back in the day!

I have a Nope app running in Express. I got this off an open source project. It works fine. (see below)

I want to make this small adjustment. When the app is accessed, I want to send some text in a URL parameter, such as "Barbara Ann". When the page is called I want to retrieve it into a variable varSongName.
URL parameter will be like "https://quiet-peak-32801.herokuapp.com/?songname=Barbara%20Ann"

I need to know:
Is that how the URL parameter should be for Node/Express/Heroku? Do I need to point to a specific page? or server.js file?
How do I store "Barbara%20Ann" into a session variable when the page is accessed? (in ASP this was Request.QueryString("songname")

Thanks


FYI: the open sourece project is here https://github.com/squallooo/MT5
0
Hi guys,

On our side we have a SAML2.0 SP implementation using simplesamlphp. Which works for dozens of customers. Including 5 ADFS customers.

But now we have one of the new integrations when things does not work. And it seems AD FS is not sending us required attributes. Customer claims that they as well have dozens of integrations and all of them work.

Their ADFS version is 3.0

Differences that we see between other responses (from successfull integrations with ADFS) and their response:
 
1.      There is no <status> xml node
<samlp:Status>
<samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status
<Assertion xmlns="urn:oasis:names:tc:SAML:2.0:assertion" ID="_36da30d0-467d-4eec-8dbd-f9da25545c61" IssueInstant="2017-08-09T12:42:00.977Z" Version="2.0">
2.      No Assertion node: <Assertion xmlns="urn:oasis:names:tc:SAML:2.0:assertion" ID="_36da30d0-467d-4eec-8dbd-f9da25545c61" IssueInstant="2017-08-09T12:42:00.977Z" Version="2.0">
3.      No “<Subject>” node. The response ends with “<Signature>” xml node. And in other successfull implementations there is a “<Subject>” node which includes all the attributes (like uid, email and etc).

What could that be? They say, all claims are setup from their side.
0
We are facing issue in cluster. We have two nodes which are in Hyper V cluster. When my node fails, VM are not switching to other node. Today suddenly, my nodes went off and I could not access my ERP which is vm hosted on this node. I have checked logs found some rror related to network.Quoram drive is accessible. Kindly find the attached error log node in jpg format.

Product: Windows server 2012, Failover cluster
1.jpg
2.jpg
4.jpg
3.jpg
0
Hi, I am using bootstrap treeview , I would like to know how I can add node dynamically at run time. means users should able to add any node.

any help will be highly appreciated.

Regards,

Aamir
addNodes.png
0
I am working with paypal payment. I want to implement payment condition below:-

Block payment amount on card at the time of reservation. If card cannot be blocked reject the event and add "Payment Declined" to the end of the description. Take payment at 12:01 am the day of the event.

For recurring events...
Block payment for first event at time of reservation. Take payment 12:01 am the day of the event.
For next event in the recurrence series, Block payment after the previous payment is taken and take payment at 12:01 am the day of the event. Continue this cycle until all reservations are complete.
 If card cannot be blocked reject the event and add "Payment Declined" to the end of the description but continue with the series of events.

Please know me how to implement.
0
Hi everyone i really need to know why i cant get to my EVO-rail manager for my vxrail. I have all my 4 nodes up and communicating i just cant get to the vxrail manager. Please help me.. the picture below show the 1st node which is shows that i have no vms.. what do i do? M i missing something ?
0
[Video] Oticon Case Study
LVL 2
[Video] Oticon Case Study

Open office environments can create the dynamics for innovation, but they also bring some challenges. With over 1,000 employees in an open office, Oticon needed a solution that would preserve the environment while mitigating disruptive background noises.

Watch how they did it.

When I hit ng serve on cmd it's not working although its working 1st & 2nd time but its not working now. All things are running perfectly. eg ng --version .. the problem is only with ng serve ..it only runs for the 1st & 2nd time..

Here is the error that cmd geneartes.

 $ ng serve
    ENOENT: no such file or directory, stat 'E:\Work\Angular\Basic website\Angular 4\my-first-app\src\tsconfig.json'
    Error: ENOENT: no such file or directory, stat 'E:\Work\Angular\Basic website\Angular 4\my-first-app\src\tsconfig.json'
        at Error (native)
        at Object.fs.statSync (fs.js:1000:11)
        at AotPlugin._setupOptions (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@ngtools\webpack\src\plugin.js:62:16)
        at new AotPlugin (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@ngtools\webpack\src\plugin.js:27:14)
        at _createAotPlugin (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@angular\cli\models\webpack-configs\typescript.js:55:12)
        at Object.exports.getNonAotConfig (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@angular\cli\models\webpack-configs\typescript.js:71:19)
        at NgCliWebpackConfig.buildConfig (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@angular\cli\models\webpack-config.js:29:37)
        at Class.run (E:\Work\Angular\Basic website\Angular 4\my-first-app\node_modules\@angular\cli\tasks\serve.js:43:98)
        at 

Open in new window

0
I have some cluster warnings after running the cluster validation wizard in my test environment on Virtual box Environment.
I have 2 Server (SQL-E and SQL-F) and 1 Domain Controller Server I should able to ping each other:
node1 -
10.10.10.50

node 2
10.10.10.60

both nodes connected to DC server(10.10.10.10 = iscsi target which is Domain controller Server)
When I validate to create the cluster. Now i receive 2 warning:
validate ip configuration
validate network communication
Going to "validate ip configuration" i see on both nodes a Local Area Connection 11 with an APIPA 169 address but looking on both servers i don't see this Local Area Connection 11 in network sharing center.
QUESTION1: How do i solve the below Error?
Going to "validate network communication" i see the warning below:
--node1 and node2 are connected by one or more communication paths that use disabled network. These paths will not be used for cluster communication and will be ignored. This is because interfaces on these networks are connected to an iscsi target. Consider adding additional network to the cluster, or change the role of on or more cluster networks after the cluster has been created to ensure redundancy of cluster communication.
--the communication path between network interface node1-nic1 and network interface node2-nic1 is on a disabled network.

This is driving me mad and I tried to ping back and forth with all servers. i should be able to reach. I do not have any clue to …
0
What will be the omnirpt command to get the list of all tapes used for the backup of a node?
0
We have  hosted  a UI application using Node js on AWS Elastic beanstalk in production environment . Because of minimal 1 to 5 % 5XX errors the EC2 instances keep going into degrade and then warning state. This is happening for very few minutes time interval. After sometime EC2 instance goes into normal state.  How to configure the threshold for 5 xx error so that we cannot see the server into degrade or warning state.
Server_State.PNG
0
I'm using one of the free Wordpress themes 'SELA'.

On this page I want the lower iFrame (the multitrack player) to extend across the page. At the moment it is restricted, even though the page template is called 'Wide Page'. The width of the iFrame is set to 1200px.
http://www.ontaraj.com/test-wide-page/

These seems to be a restriction on the theme that prevents a full width iFrame. How can I get round that please?
0
I'm trying to understand how this works so that I can make a few small tweeks.
https://github.com/squallooo/MT5

When the page opens a dropdown list is populated, and a song selection can be made.
I can see that a Function loadSong(songName) { ...} is fired off at that point. (it is in sounds.js)

I have found that I can force the song by doing this on line 342
currentSong = new Song("Londres Appelle", context);

Open in new window

"Londres Appelle" is a song in the demo list.

My question is, would it be possible to force a 'song' in this function by using a URL parameter?
eg.
http://www.mydomain.com/index.html?songName="Londres Appelle"

My background: JavaScript and Node.js newbie. Worked extensively with Classic ASP and VBScript back in the day  (2001-2003). I understand using QueryString to pass a variable to a page, but I don't know if I need to think differently in Node.js.

Thanks.
0
Hello I want to change my node location from "TOP" to "warehouse". Can someone please tell me the command?
0
Hi all

The UI for my react app has a main section (takes up most of the screen) and a left hand side pane.
I'm using 3 separate ag-grids:
-One as the main one on the main screen holding the important data.
-the other two are in the left hand side pane (the less important grids for assistance/statistic holding).

This left pane uses (two) tabs, i.e. click on one tab to see one ag-grid, click the other tab to see the other ag-grid

For the tab functionality, i used npm to install the NPM react-bootstrap-tabs node module.

Recently I managed to set up one of the left pain ag-grids to hold filtering information from the main grid.
This was quite a hassle since the grids were effectively grand-sibling components which needed to communicate. without touching AG-grid src code, I had to set up ag-grid callbacks to take note of the filtering data from the main ag-grid, send it up to the grandparent component of my app, and then send it back down to the other grand child ag-grid component.

It all works however I noticed a glitch. When initially loading the whole page, the first tab in the left pane is active by default. The left pane ag-grid that holds the filter information is in the second tab. What I want is to click on this second tab, and see filter data be populated automatically as i filter the main ag-grid. However when I have the second tab active and i filter the main ag-grid (i.e. adding filter …
0
Hello nodejs experts

Is there is anything more on node js standards?  


All urls must be in lower case

Ex: /notification/sendotp

Use HTTP verbs (GET, POST, PUT, DELETE) to operate on the collections and elements.

Use GET – for retrieving single or list data

Use POST – for create data

Use PUT – for update data

Use DELETE – for delete data

HTTP METHOD

POST

GET

PUT

DELETE

CRUD OP

CREATE

READ

UPDATE

DELETE


URLs should include nouns, not verbs in API names. Avoid get,update,save, delete, list in API names.

Maintain singular and plural nouns for APIs.

Ex: for single image retrive – GET - /user/image

For list of images – GET – user/images

User Token must be in headers only. Not as path param or in json body

Use resource, sub-resources for relations

Ex: for user videos use - /user/videos

Put the version number at the base of your URL. /v1/user/images

Controller will have only mandatory parameter validations and sending success, error responses no business logic. Use Service and Helper files for business logic. DAO for db calls

Handle Errors with HTTP status codes

200 – OK – Everything is fine. Created, Saved, Data found

400 – Validations Failed, Missing Mandatory Params, No data found, User already exists, already voted, in valid comment, comment not allowed within a hour, invalid user, invalid video, Video not found

500 – Unknown error, Database error, ES down, timeout from third-party. …
0
Creating Active Directory Users from a Text File
LVL 6
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Hi,
I'm trying to setup a new webrtc instance behind the firewall where tcp 80 and 443 ports are only available.
All is fine as long as udp ports are enabled. Once I block udp, I can't establish a client connection.
The stun/turn server has been setup however connections are not redirected from webrtc.

RTCMultiConnection.js config:

var IceServersHandler = (function() {
        function getIceServers(connection) {
            var iceServers = [];
iceServers.push(getTURNObj('turn:my.domain.com:443?transport=tcp', 'user', 'pass'));
            if (window.RMCExternalIceServers) {
                iceServers = iceServers.concat(getExtenralIceFormatted());
            } else if (typeof window.getExternalIceServers !== 'undefined' && window.getExternalIceServers == true) {
                connection.iceServers = iceServers;
                window.iceServersLoadCallback = function() {
                    connection.iceServers = connection.iceServers.concat(getExtenralIceFormatted());
                };
            }

            return iceServers;
        }

        return {
            getIceServers: getIceServers
        };
    })();

turnserver.conf config

listening-port=80
tls-listening-port=443
listening-ip=10.10.10.10
relay-ip=1.1.1.1
external-ip=1.1.1.1/10.10.10.10
lt-cred-mech
user=user:pass
realm=domain.com
no-udp
no-dtls
no-udp-relay
cert=/usr/local/etc/cert.pem
pkey=/usr/local/etc/pkey.pem

All is running in AWS cloud.

0
I am learning Angular, Node, npm, deployd, mongodb, etc.  I am making my way through a book titled "Pro AngularJS" by Adam Freeman.

on page 120 I am attempting to prepare the data for a "real world" application called "sportsstore".

I was instructed to install a module called "deployd" which apparently is used for modelling  API's for web applications.

I did that and when I try to start start the "deployd" service I get an error:

C:\PROGRA~2\deployd>dpd -p 5500 sportsstore\app.dpd --mongod
starting deployd v0.8.9...
internal/child_process.js:289
  var err = this._handle.spawn(options);
                         ^

TypeError: Bad argument
    at TypeError (native)
    at ChildProcess.spawn (internal/child_process.js:289:26)
    at exports.spawn (child_process.js:380:9)
    at Object.exports.restart (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\lib\util\mongod.js:38:14)
    at Command.start (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\bin\dpd:149:16)
    at Command.listener (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\node_modules\commander\index.js:301:8)
    at emitOne (events.js:96:13)
    at Command.emit (events.js:188:7)
    at Command.parseArgs (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\node_modules\commander\index.js:617:12)
    at Command.parse (C:\Users\knowlton\AppData\Roaming\npm\node_modules\deployd\node_modules\commander\index.js:458:21)
    at Object.<anonymous> 

Open in new window

0
I have to write a Node.JS application that connects to a remote server.  The remote server has a login manager that authenticates my session then spawns a separate process to handle the rest of my session.  The way that works is that I have to make a non-SSL network connection to the login manager and do an initial unprotected handshake.  The lets the client and server negotiate if they will be doing SSL or plain text communications.  If SSL then I need to elevate my socket to an SSL socket, send my login and password along with some other initial information, then get a success of failure message back from the login manager.  If success then I know the login manager is starting a new process and handing off my open socket connection to that new process.  Since the server can't pass the SSL context it de-elevates the SSL connection and runs a program passing it the non-SSL open socket.  Then the new program creates it's own SSL context on the open socket. So in my Node.JS code I need to close the SSL socket but leave the raw socket open.  The new program will send me a success message when it is up and running at which time I need to re-elevate my open socket to SSL again.

My question is how can I close an SSL socket leaving the raw socket open so I can continue to use the raw socket and then re-elevate it to SSL again?
0
I have a node.js module that needs unit test. Here is the key relevant code:

old code:
                const memsqlPool = {
                    execute: sandbox.stub().resolves(!mockPara || mockPara.memSqlResult || ''),
                };
                sandbox.stub(my-lib.memsql, 'Pool', constant(memsqlPool));

In the source code:

const {memsql} = require('my-lib');
const memsqlPool = new memsql.Pool(my-config);
        function getInfo(id){
            return memsqlPool.execute(my-arguments).then(my-mapping-object);
        }

This code actually hints that memsqlPool.execute() can only be called once in any given test case, because it always returns the same results.
Now I have to make two memsql calls, one depends on another.  I try to make it something like:

memsqlPool.execute.onFirstCall().returns('some-value');
memsqlPool.execute.onSecondCall().return('some-other-value');

But just do not know how to fit this idea into the unit test code above.

Anyone can help?
0
I need a identity server for Node.js that works with relational databases
0
I am a relative newbie to node.js and typescript and am looking for tutorials and examples for building custom libraries for typescript. I am currently working on a project(switched to webstorm GUI) that requires I build several microservices and several of the microservices will need to share certain code, i.e., base repository functionality, etc. My though would be to move the code they have in common to a series of separate libraries(projects) and make them into typings and have the projects that need them to install them. Following the example I found here, and using grunt: What is the story for creating and consuming TypeScript libraries?, I was able to generate the .js file and the .d.ts files in a dist folder on the project. There are a few areas that I am confused about:

1) The example makes reference to a "main": "./dist/my.service.js" section in the jsconfig file, how necessary is this file and what should go into it?

2) If all of the files are transpiled and added to the dist folder, will the dependent code still be able to access it or do I have to transpile all of the files to root?

3) After I have have all of the file successfully transpiled and moved to the proper location, how do I install them to the dependent project if they are local and not up on the npm or Definitely Typed, etc.?
0

Node.js

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Top Experts In
Node.js