1

I have got 2 applications: Nodejs application and Angular application. I would like to host them both on the same Linux server (Linode). Also I have a DNS record for example : forexample.com. I would like that when I navigate to api.forexample.com it will navigate inside the linux server to the Angular application, and I should see the angular pages. The nodejs application is a API application which I would like other people to make all the HTTP requests to api.forexample.com/api.

So the question is how to make the navigation inside the linux server?

chen20032
  • 115
  • 2
  • 10
  • There is no point in comparing Angular and NodeJS - Angular is a front end framework and nodeJS is server-side platform that allows you to run javascript on server. Do you understand the difference? – codtex Feb 28 '18 at 10:24

1 Answers1

2

Generally speaking to run multiple applications on a server. First you need to add an A record on your DNS record for api.forexample.com Then you can use nginx to handle the two applications. The way it will work is that each application will run locally on its own port and nginx will handle the url you provide and map it to the appropriate application. Check out this tutorial: Configure Nginx as a web server

In your situation you could serve the angular app from the node application. Check this too: How to serve an angular2 app in a node.js server

Giannis Mp
  • 1,291
  • 6
  • 13