How to embed app nodejs in java application

3

There is an application developed in spring and angularjs, the problem is that they want to make an app in nodejs and be able to embed it within the java application, I mean

Something like pressing a button, and look at your node app, suppose you add a calculator, a form that occurs to me with an iframe, I have the app node running on a server and calling iframe with that route when the button is pressed, however other forms are there? , and which ones would be the most recommendable, thanks.

PS: There is no possibility to change the spring app, nor the node app.

    
asked by Kevin AB 25.02.2017 в 17:10
source

2 answers

3

Simply reference the nodejs app within a iframe and you're done. It is the fastest, simplest and most effective way since, for practical purposes, it is more about embeber a web within another, regardless of whether the backend is in different languages.

Apart from that, I'll give you a couple of interesting projects in case they can help you or give you new ideas:

answered by 06.03.2017 в 08:22
0

Since your nodejs application is made using Angular, you can simply load it into a node of the DOM and thus not have the need to use an iframe.

If you followed the [ link Started), you will have noticed that when creating your component initial defines your html tag:

import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  template: '<h1>Hello {{name}}</h1>'
})
export class AppComponent { name = 'Angular'; }

and then you mount it in the HTML using:

<my-app>Loading AppComponent content here ...</my-app>

so in your Spring application it would be enough to include the generated bundle (JS, CSS, images, etc) and apply the label that you defined as your app.

    
answered by 06.03.2017 в 17:54