简体   繁体   中英

develop several node.js based application on the single windows machine

Currently I'm implementing 2 node.js application. Backend system and Angular based frontend app who consume backend via API. But I faced with a problem - how to manage this correctly?

Because to avoid CORS both backend/client should be hosted in single domain (but different subdomains) and listen the same port.

Could anyone share his experience how to deal with it?

I will use express.vhost it is from connect.vhost :

http://www.senchalabs.org/connect/vhost.html

connect()
  .use(connect.vhost('sub.domain.com', subApp))
  .use(connect.vhost('domain.com', aap))

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