• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic