部署java后端和Javascript前端
I have an app that I would like to deploy to Heruko. The REST
API is built with Dropwizard
and Gradle
and the frontend is built with javascript
. Is there a way to deploy the two together in the same file structure?
我有一个应用程序,我想部署到Heruko。 REST API使用Dropwizard和Gradle构建,前端使用javascript构建。有没有办法在同一个文件结构中将两者一起部署?
1 个解决方案
#1
0
You can use Heroku's support for running multiple buildpacks on an app. In short, you can run this:
您可以使用Heroku的支持在应用程序上运行多个buildpack。简而言之,你可以运行:
$ heroku buildpacks:clear
$ heroku buildpacks:add heroku/nodejs
$ heroku buildpacks:add heroku/java
If your app has a package.json
and a pom.xml
this should pretty much just work. The only caveat you might run into is the dependencies
versus devDependencies
in the package.json
. The Node.js buildpack will not install devDependencies
by default, so you may need to run:
如果你的应用程序有一个package.json和一个pom.xml,这应该只是工作。您可能遇到的唯一警告是package.json中的依赖关系与devDependencies。默认情况下,Node.js buildpack不会安装devDependencies,因此您可能需要运行:
$ heroku config:set NPM_CONFIG_PRODUCTION=false
Here is an article that describes this setup for Using Grunt with Java and Maven to Automate JavaScript Tasks, but it's basically the same for Gulp.
这篇文章描述了使用Grunt和Java以及Maven自动执行JavaScript任务的这种设置,但对于Gulp来说基本相同。
I don't understand your question about the symlinks.
我不明白你关于符号链接的问题。
EDIT:
Maybe the symlinks question implies that the code for the frontend and backend are not in the same repo? I recommend merging these, or using Git submodules. Or you can package the whole app (frontend assets and backend code) into an executable JAR file and deploy with heroku-cli-deploy.
也许符号链接问题意味着前端和后端的代码不在同一个回购中?我建议合并这些,或使用Git子模块。或者,您可以将整个应用程序(前端资产和后端代码)打包到可执行的JAR文件中,并使用heroku-cli-deploy进行部署。
更多相关文章
- javascript encodeURIComponent并将空格转换成+符号
- 如果外部应用程序更改了持久模型(服务器数据库),AngularJS可以自
- 在两台服务器上有效地在两个Django应用程序之间进行通信(多租户)
- 如何停止Py_Initialise应用程序的崩溃?
- 轮询Web服务的最佳方式(例如,对于Twitter应用程序)
- 乘客的Django应用程序显示空主页
- 用于在Google App Engine上构建应用程序的最佳开源IDE?
- 获取Android应用程序的Linux UID
- 我应该在哪里添加Yocto位烤任务来创建工作文件夹符号链接?