简体   繁体   中英

Getting two mean stack applications to run on the same page/port number

Currently have a calendar and to do list application built in mean stack. They're currently in two different files which means they're running on port 3000 and 3001 seperately. Any idea on how to get port 3000 and 3001 to run on port 3002 so both apps appear on the same webpage? Running Ubuntu 16.04

Since, you cannot run two applications on the same port, you need a reverse proxy which can divert the call to each application (3001/3002) based on some logic.

For example something like this

                  +--- host/calendar --------> node.js on localhost:3000
                  |
users --> nginx --|--- 
                  |
                  +--- host/todo ---> node.js on localhost:3001

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM