How to use nodejs with spring mvc - node.js

I am using spring mvc as a backed in my project and client side is managed by angular js everything is working fine, but now I want to use some socket type of technology in my project so I googled and I found socket.io is commonly used with angularjs but it require node.js for running the app, but currently my project is running into tomcat server which is accessing 8080 port and node.js is in another port so I am facing problem to integrate my project with socket.io and node.js. So please anyone give me some suggestion for this or am I doing something wrong.

Related

how to deploy an ionic-react app to mobile if I'm using node js server in the backend?

I discovered ionic this week and I'm really considering using it at work.
Basically, my goal is to build an app that will work on android and Ios, where the needed functionality is to connect to the cloud over web socket and pull data from the cloud and show it on my phone. Maybe later I'll eventually need to consider using login but not for now at least.
Normally, if I'm building a web app. I ll use nodejs to pull the data from the cloud and expose it to the frontend. I ll write all code together and I ll host my app in Heroku or something where the entry point is my nodejs server right? So that my server needs to start and it will take care of the rest.
This is a bit confusing in ionic since I need to start the app with ionic serve, but somehow I also need to start my nodejs server too right? So I assume I can't write the server-side code inside the ionic app or am I wrong?
There is not much about this on the internet but I did some research and I guess that I should deploy (host) my nodejs server in the cloud (maybe using Heroku) and then connect to the server from my mobile app over the socket. Is this the right/only way to do this? are there any security issues with this method?
I find ionic great but I'm not sure if I should use it at work. Sincerely, this use case of using a backend server with ionic made me confused.
Ionic looks ideal for building cross-platform apps that does not need server-side scripting, but how complex can it be if I want to integrate some server-side code in my app? especially as I said I'm going to use some login forms in the future to extend the functionality of my app.
PS: I'm using ionic 6.10.1 and specifically I'm interested in using ionic with react not with angular.
After some search, I discovered that it isn't possible to deploy the frontend and backend code together. Therefore the trick is to deploy the nodejs server separate from the frontend.
Precisely, if it is a web app, then you should deploy the nodejs server in a separate host from the frontend. Then by starting the frontend app, you can communicate with the running nodejs server via socket or REST API.
Hope this helps someone in the future :)

how does node js, when used as a server, can be defined in the context of a web server/ application server?

I try to understand the architecture nodejs, when using it as a server trough framework such as express.
I know all these concepts of web server, application server, and a web container but I don't
think that I fully grasped where does nodejs as a server it's to all of this.

Merging angular2/4 files to Node.js server

Request you all to please help me on below question:
Premise:
I have created a working application- client-side using angular2 and server-side using node.js (Rest services are used). Both client and server using the different default port 4200 and 3000 respectively. Since this application is not that big and my company doesn't want to open any extra port for security reason hence I was suggested to move all angular files to node.js server which then thereafter host the entire application.
Question:
How can I move all my file from angular2 and add them to node.js so that it works as it was working before? There are many dependencies exist in angular2, similarly, it bootstrap components in a different way then how can I use angular files in node.js?
Any suggestion or solution are deeply appreciated.
You can you ng build. This command will generate a dist folder and your node server can read it. If you use expressjs you can see the example MEAN Stack (Angular 5) CRUD Web Application Example .

How do I create a local server in packaged chrome app which runs offline?

I want to create a Node.js server in chrome app so that I would be able to run node.js applications through it. The app would run offine therefore the server had to be local.
As I was not able to do my setup in Chrome app, I used node-webkit for making my project to work and setup my project as
General Information
Express Server is started on port no 3000.
EJS is used for HTML renderer for ExpressJS
PeerJS Server is started on port no 9000.
IndexedDB is used for database purposes.
PouchDB is used as wrapper for IndexedDB
blueimp-file-upload is used for FTP over express server.
AngularJS is used for creating modules for front-end.
LUMX is used as UI framework.
jQuery is used for DOM Manipulation.
Velocity is used for smoother animations.
Complete code can be found at my github pulic repo
https://github.com/sumitkumar1209/PQ-PinQuip-Messenger

Deploy node.js on local server

I am currently running a website written with Flask on a LAMP server. I used mod_wsgi to connect the Flask app with Apache, and all is running well. However, I recently discovered websockets and would like to use them in my website. There is a Flask extension for websockets, but I was told Apache does not support websockets and that I could not use it.
I was introduced to Socket.IO running on nodejs at school, and I would like to try it out for my website (rewrite my website using nodejs). My question is how do I run the nodejs app from my local server as I did with my Flask app? I have searched Google, and people are recommending using Apache or Nginx, but will they support websockets? Thank you.
By launching your nodeJS server... Take a look at : A simple TCP based chat server written in node.js
(I'm not the author and I don't know him)
Then just: node myFile.js

Resources