RESTful NodeJs express server takes long to respond - node.js

I have a RESTful NodeJS express server. When I make an API call the api retrieves data from a mongodb server hosted on modulus. While running the server from localhost sometimes it stops responding. When i query the database using robomongo it works. So I dont think there is a problem with the database connection to modulus. Is there any known issues regarding this ?

Related

Socket.io, Unreal, & Heroku (Node js) : Client not connecting to server?

I'm currently working on a game that connects to a Node.js server for multiplayer data.
The game is developed in Unreal Engine 4 and uses the Socket.io plugin to connect to the Node.js server (cors, express being used).
Everything works locally. So now I'm trying to move on to hosting the server remotely and connecting the unreal client to the remote Node.js server.
I looked into Heroku and set myself up, everything is working fine on its end to my knowledge - I created a tester page with a success message when you load the URL and that comes through.
My first question is - what am I doing wrong when I use unreal to point the socket.io plugin to the server url?
The socket.io plugin asks for a port #, I've tried the following:
http:/{my server/heroku url}:8080/
http:/{my server/heroku url}:3000/
http:/{my server/heroku url}:18279/ (which was given to me by Heroku).
http:/{my server/heroku url}/
So far the game does not connect to the deployed server, the way it does locally.
Any suggestions on what could be going wrong/what am I failing to do next?
A few things after researching:
I do have http-session-affinity enabled
Since the server is working locally, I'm going to make the assumption that the deployed code is not the issue, and that it has to do with the way I'm trying to connect.
is it possible that I have further authorization to config? Such as allowing the unreal game/client to connect to the server/that the client is being blocked some how?
I figured out the issue, it had to do with how my Node.js server code was calling socket.io.
If you come across this issue please send me a message or comment here and I will be happy to send you the code that worked.

Angular6 makes API call to localhost from Server

I have an ndoejs/express app, which serves an angular6 application. Inside my angular6 app Im making http calls to my restAPI. If I host the App on localhost its working an connecting to my API.
But if i push the App to my VPS, the API call is also made to my local maschine. Is there a way to let the Angular App make the call to the VPS maschines running nodejs API? I would not like to change url everywhere in the app...
Im using Sequelize to connect to the databse etc.
Thanks.
You can add different environment files, that will hold specific settings for that environment. Have a look at this article.

connection with oracle database in Reactjs

I am doing a database project using reactjs for frontend and Oracle database for the database connection.
Many sources for the connection of React and MySQL are available but there is hardly any source for connection with the oracle database in React.How do i do it? documentation for nodejs oracle connection is available.so i can connect with the database but how do i show results on localhost using Reactjs?
I have tried to create a simple javascript file and connect with oracle in it.I was able to get data on the console but how do i post it on localhost?
You need apis for acting as a bridge between reactjs application and oracle db. You can use any backend stack for oracle db connection and apis like nodejs, python etc. Reactjs is not to be used for server side applications, its only for the frontend meant to be running inside a browser.

Need help http Server and client server

I have used an application for login, adding friends and chat using node.js and mongoDB.I installed the node.js and monogoDB on ec2 instance. However, I do not know if need to use client server and http server?
Here is the application that I used https://github.com/1karthik/Node.js_UserLogin_Template
note: I am new to node.js and mongoDB
you dont need a "client server". Your http server will serve to your clients some javascript files that will help them to comunicate with your server. If you go in app/public/scripts you can see theese files.

Two nodejs server connect to one MongoDB server at the same time

Is there any problem if I use two nodejs server connect to one MongoDB server at the same time?. Can this way create any read/write issue on mongo instance?.
The same question for another case: One nodejs server connect to two MongoDB server at the same time?

Resources