Can i deploy spring restful webapplication in node - node.js

is it possible to deploy spring rest application in node / node server.
I have a spring rest application where there are many endpoints.
As far as i understood node is lightweight. so can i deploy the application in node. If so, how to do it.

No, you can't.
You are comparing apples with oranges.
A Spring app is deployed inside a Java runtime.
Node.js is a Javascript runtime, a way to run Javascript code outside of the browser.
You cannot deploy Java applications inside a Javascript runtime.
Regarding the performance of a Java vs Javascript backend the answer is not straight forward.
It depends on the framework/libraries you are using and how you write the application code.

Related

IIS/ASP.Net vs NodeJs/ExpressJS

I'm very new to NodeJs/expressJs, i read tons of articles on internet and still don't understand it
is NodeJs a web server like IIS ? if so can i host an asp.net app in NodeJS ?
Is expressJs a framework like ASP.NET ?
I currently work on both IIS ASP.NET applications as well as NodeJS/ExpressJS systems and the below is what I have noted to be different:
IIS:
Windows server based
Can have strict setups such as MVC etc
Built in deployment that compiles the entire website
Setup can take quite some time to create all modals and get all
plugins working etc
Services can take some time setup and modal mapping can be tedious
NodeJS/ExpressJS:
Not Windows based. I run this typically on an Ubuntu server with
Nginx to push the domain to the public
Easy to setup and fast to get something basic online
Does not natively compile and runs files as they are
Uses npm package manager with easy to install packages
Does not have strict setups but you can technically create your own
MVC style system
Code can quickly become messy however with the correct approach you
can manage the amount of code easily.
NodeJS is not a web server. It is a backend server (Such as a REST API etc)
ExpressJS sits ontop of NodeJS to add functionality and is essentially a framework. Coupled with jade/pug you can write js inside the html.

Can we use angular project and that will use in my two different API backend projects (i.e. node and .net core)?

For an example, I have one angular ui project that fetches values and perform operations.
I have one backend API project in .Net Core and now I want to reuse angular ui project with node js.
Is it possible?
How to configure it and which are the main points to take care that angular project support both.
How can I deploy it?
Angular is a client side application that run's in clients browser, as long as the REST API or service you connect has Same API endpoints and same object models and authentication etc everything will work as intended.
REST is platform independent like the web services and also language independent. It doesn't matter if you use .Net Core or some nodejs framework.
Once the angular application is build ( ng build --prod) you get a bundled application files in dist folder you can host these files in any web sever just like you host normal html file.
The only change you have to make in the the Angular application will be to change the host URL (if there is any change) normally configured in environments folder
Take help of environment file and change the api as per your requirement.

Chatbot using Api.ai nodejs angular socket.io

I have been using api.ai javascript SDK on angular to build my chat app to integrate it with the website. As this javascript sfk is deprecated I am now exploring to build the same on Node JS SDK with socket.io for real-time experience and angular for client features...
Currently, I'm following the below link to build my chat app
https://codingblast.com/chat-application-angular-socket-io/
As I am very new to Node I have lots of doubt like...
How to deploy my node and angular app on a server to host it on my website
Angular and node can it be deployed as a simple app.. if so what are the steps and how could I achieve it.
Is node is possible ti have multi threading as many users might chat with my chatbot in parallel before on angular it will be acheived by session id.. but how it is possible on the node?
Is it fine to deploy my node app on my existing apache server or should I use separate server
How can I host multiple node js chat app on a single server since each app will use a port... how much it is possible...
Which server is recommended for node deployment windows ubuntu or Linux.
Please help me...
Angular Apps are static files that can be served using any server. For NodeJS, you will need a server that supports NodeJS runtime execution environment. A simple cloud server will do. (AWS or others that you may prefer)
Angular runs on the client-side, NodeJS runs on the server-side, there is no "Simple App Deployment" (as far as I've known). You need to run the NodeJS server code which will server the REST API, and send the Angular deployment files to the client with some file server. (Even the NodeJS server can do it)
"Node.js is a single threaded language which in background uses multiple threads to execute asynchronous code" [Source]
But you can use "fork" to run parallel tasks. For chatbot, you may consider using WebSockets.
It is possible to run NodeJS with Apache server, but how you want to deploy it depends on your decision and architecture. See HERE for more information.
Link in no. 4 should have answer this this.
NodeJS can be deployed on both Windows and Linux(Ubuntu) environment. It depends on how much you can spend, and how much benefit that expenditure will bring you. (Linux server operating systems are totally free, Windows servers aren't)

Do we need Node.js and Express.js while working with Angular2?

I built a sample web application using the following -
Angular 2
TypeScript
ASP.Net WebAPI 2
Mongo DB
Karma/Jasmine
Node.js (only as a server, just to the extent as specified in Angular2 Quick Start)
Considering the above tech stack do we have any need of using Node.js or Express.js for building a production web application? Is any of the above tech is replaceable with Node/Express, for better performance/memory utilization/code maintainability/faster development?
You'll need Node.js for development time tooling - for instance, TypeScript compiler and running Karma/Jasmine tests.
Regarding Express.js - you can do without it. An Angular 2 application does not rely on a back end framework. It could be served as static assets from a web server. Pick any back end framework that suits your needs.

Angular application requred node.js

I am going to create my first angular application. I have read lots of angular tutorial and many of them mentioned node.js.I am really got confused here.
Do we really need to install node.js and other dependencies to run angular application ?
Can't I just add respective angular libraries in my eclipse and create Angular application?
What are advantages of using node.js?
Also it is necessary to add all angular code is under App folder?
Regards,
Dip
As it is said on note.js website
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
So it depends if you want to have server logic (services) or not. If you are creating just the UI of the app you don't need note.js. Also Angular is NOT dependable on note.js

Resources