SQL 如何在 node.js 中使用 Spring MVC

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23363667/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 01:46:48  来源:igfitidea点击:

How to use Spring MVC with node.js

sqlnode.jsspringangularjsyeoman-generator

提问by

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?

我想知道是否可以将 Spring MVC(使用 Gradle)与 node.js 作为 Web 服务器一起用于后端内容,以及如何使用?他们通过 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.)

我想使用 node.js 的原因是我想使用一些模块,例如 Yeoman(使用 angular-generator)、grunt、bower、socket.io 等和 Angularjs(用于路由、控制器等)

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

我还想使用 sql 数据库(mysql 或 sqlite)而不是 nosql 数据库,例如 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?

这是如何实现的?我是否只是将前端内容的 node.js 添加到我的 Spring 项目中?是否有任何我可以遵循的教程或我可以查看的存储库?

Edit

编辑

I have checked out JHipsterbut 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.

我已经检查了JHipster,但它不是我正在寻找的。是否有一种更简单的方法,您只需将两者结合起来并使用 gradle 而不是 maven?我觉得 JHipster 有点过分了。

采纳答案by geoand

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)

尽管这不是您所要求的,但请查看JHipster。它是一个 yeoman 生成器,它在前端使用 AngularJS 引导 Spring 后端项目(以及 Bower 和 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

我发布这个是因为 JHipster 它似乎满足您的大部分要求,并且可能比 Spring 和 Node.js 的一些临时集成更容易使用

回答by FriendlyMikhail

Hereis a spring article from a while ago of using spring, mongo, and nodejs in a project together.

是前段时间在一个项目中一起使用spring、mongo和nodejs的spring文章。

Additionally, spring has 2 guides for accessing relational data such as mysql: relational-data-accessand accessing-data-jpa

此外,spring 有 2 个用于访问关系数据(例如 mysql)的指南:relational-data-accessaccessing-data-jpa