How to use Spring MVC with node.js

user2539369 picture user2539369 · Apr 29, 2014 · Viewed 20.8k times · Source

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

The reason I would like to use node.js is that I want to use some modules such as Yeoman (to use the 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? Do I just add node.js for the frontend stuff to my Spring project? Are there any tutorials I can follow or repositories I can check out?

Edit

I have checked out JHipster but its not exactly what Im looking for. Is there a simpler approach where you just combine the two and use gradle instead of maven? I felt like JHipster was just a bit too much.

Answer

geoand picture geoand · Apr 29, 2014

Although it's not exactly what you are asking for, check out JHipster. It's a yeoman generator that bootstraps a Spring backend project with AngularJS in the frontend (along with power of Bower and Grunt)

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