Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to deploy RESTful project on Tomcat with angular 2 project on eclipse?

 
ilya shusterman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there guys
I have my wep app project with rest servlet all http requests working good - the Backend Project,
Also i developed also an Frontend project with angular 2 My main question is how to make them work together?
A.should i get them work on the same server? if it is the answer how exactly ? cannot deploy an angular2 app with non workable node.js dependencies... or is there another way?
B.should i get them work sepratly run Tomcat on The server and deploy another server on angular 2 so how i make http requests , tried Cors filter and does not let me do all the http requests and i lose the authentucation filter.

***An important note****
My app contains a login page for the user so there must be post requests working , and some authentucation from back end or front end app
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deploying them from the same domain avoids CORS issues. Whether they are both served from Tomcat or not is irrelevant.

It's very common to have the static pages (Angular app) served via Apache (or Node), and the RESTful API via Tomcat (or other app server). But there's nothing wrong with serving them both from Tomcat if that's easier.

One thing not to do is to try and combine them into a single web application.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. Eclipse is an IDE and has little to nothing to do with production deployment.
 
ilya shusterman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First thank you very much for the reply.. i am totally agreeing with you about not to combine them to a SPA
But I am making an Single web application based on angular 2 that sends http requests to the backend project this is my goal
the whole idea and my question, is how do i make this the right way?

you are right again about eclispe ide , man but this is all i got now.. so i have to make the best out of it i dont got any time with this projects i really got to finish quickly

 
ilya shusterman
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well i found also this source code for rest with angular 2 but the backend is on javascript  https://github.com/auth0-blog/angular2-authentication-sample
im not sure if this is going to work with restful api jax rs , any thoughts?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!