How to use Spring MVC with node.js

I would like to know if it is possible to use Spring MVC (using Gradle) for the backend file along with node.js as a web server and how? Do they communicate through JSON?

The reason I would like to use node.js is because I want to use some modules, such as Yeoman (use angular generator), grunt, bower, socket.io, etc. and Angularjs (for routing, controllers, etc.)

I would also like to use a sql database (mysql or sqlite) instead of a nosql database such as mongodb.

How is this achieved? Am I adding node.js for the frontend in my Spring project? Are there any tutorials that I can track, or repositories that I can check?

Edit

I checked JHipster , but that is not quite what I am looking for. Is there a simpler approach when you just combine the two and use gradle instead of maven? I felt that JHipster was just too much.

+6
source share
2 answers

Although this is not quite what you are asking for, check out JHipster . This is a yoman generator that launches a back Spring project with AngularJS in the interface (along with the power of Bower and Grunt)

I posted this because JHipster seems to satisfy most of your requirements and is probably a lot easier to use than some ad-hoc Spring and Node.js integration

+5
source

Here is a spring article from what you used spring, mongo and nodejs together in the project.

In addition, spring has 2 guides for accessing relational data such as mysql: relational-data-access and accessing-data-jpa

+2
source

All Articles