1

I am working on one application which has rest services and these rest services are running on tomcat server. I have one more tomcat running which has only UI part.I have built this UI in Angular. I am creating a war out of these Angular related files and deploying in this tomcat, which is accessing other tomcat's rest services.

I have two options of running my UI code, I can either use tomcat or use express js, but I am not sure which to use. As I am comfortable with tomcat, so I am using tomcat only but if using express on node platform is more beneficial then I should be using that. Could anybody please explain the pros and cons of using express js over tomcat for my UI project.

Mayank
  • 43
  • 2
  • 9

2 Answers2

3

Overall it doesn't really matter. Both tomcat and NodeJS/express can do the job.

The benefit of NodeJS is that you are using the same language (javascript) on the front-end and on the back-end.

The benefit of Java/tomcat is its maturity. There's a lot more tools, IDEs, etc for Java than for NodeJS code.

There's also the difference between a scripted language and a compiled language: Scripting Languages vs. Compiled Languages for web development

If you are trying to get things done, I would stick with Java/Tomcat since that is what you already know. You don't want to waste time figuring things out.

On the other hand, if you you have plenty of time to complete your project and have time to learn, I would recommend going with Express. It's a framework with growing popularity and it's always nice to be able to write the whole app in one language (aside from CSS/HTML).

Community
  • 1
  • 1
swbandit
  • 1,986
  • 1
  • 26
  • 37
0

Express is overkill to serve static files and slower than a native http server. Even Tomcat is overkill imho (it's not a simple web server). If you're looking for a light and fast way to serves static files, there is nginx: benchmark here. Or you could stay with Tomcat, it's already setup and faster than Express.

Community
  • 1
  • 1
Shanoor
  • 13,344
  • 2
  • 29
  • 40