Home > Mobile >  Deploying a node.js frontend and spring boot backend as a self contained app locally
Deploying a node.js frontend and spring boot backend as a self contained app locally

Time:03-31

I have a web app that has a separate spring boot backend and a nodejs frontend.

is it possible to make them both run on the same bundle, like building a singe executable? or do i need a stand alone service for each? Both are having their own jenkins pipelines and git repositories.

My backend server is just a API that provides the frontend with simple data via REST services. If it is possible what would be the way to do it?

CodePudding user response:

A nodejs is a backend technology, not frontend.

You can use a nodejs as an entry point to a spring boot application but it is a code running on the server side. So nodejs is not just a list of static files as it happens for a real front end developed in react, angular or vue (or vanilla javascript). It has also an engine to run the code.

So is not possible to run nodejs server using files that are compressed in the executable jar. Instead is possible to put a real front end application (react, angular...) adding static files in the directory /resources/static

CodePudding user response:

It was maybe a little missleading. My frontend is an app runing on node.js server and may backend is a java app runing on spring boot server. They are communicating on localhost via Rest.

I want to create a single entry point that starts the node.js server (I call this unit frontend) and the spring boot server ("backend") at the same time. So it feels like a self contained system.Currently the spring boot app is delivered as windows executable.

  • Related