: Managing (routing between) two separate servers in the same web app I am building a website, where the landing page and some other content is based on node, express, angular2 etc. I want
I am building a website, where the landing page and some other content is based on node, express, angular2 etc.
I want to have a subdomain (blog.mydomain.com) which runs Hexo. On my development machine, I run hexo server to test the blog on localhost:4000. I can deploy to heroku by running hexo generate -deploy. So I have two questions - if I had a node app, where one of the sub-directories contained my current hexo project, how would I deploy it, as if I just uploaded the content, what would trigger hexo to run?
Secondly, how to I route from my main app, to the blog? I have seen a number of suggestions to use vhost with express. Would I run the two servers through different ports, and then just route /blog routes to0.0.0.0:4000 for example?
More posts by @Jennifer507
1 Comments
Sorted by latest first Latest Oldest Best
You'll need to run both node apps on different ports, I suggest using PM2, which is a free and popular tool.
Then you'll need to route from the different domains or folder to different ports.
NGINX is a very powerful tool, yet using apache is much easier to configure and will do what you need.
Here's how you might want to set your routing: example.com:80 >> localhost:80
blog.example.com:80 >> localhost:4000
OR example.com >> localhost:80 example.comblog >> localhost:4000
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.