PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 16, 2022

[FIXED] How to deploy multiple nodeJS application with different port

 July 16, 2022     node.js, web, web-deployment     No comments   

Issue

I'm rather new to NodeJS and I'd like to deploy the API and the application on the same server, which means same IP but on different ports.

From different search I saw it's possible but I don't know how. Can I use Restify for this redirection ?


Solution

in this code app.listen(PORT HERE); on your two apps just define a different ports for each one.

For example

in App1 = app.listen(3000);
in App2 = app.listen(8000);

then to access each one is like :

App1 = http://localhost:3000
App2 = http://localhost:8000



Answered By - Jose Gratereaux
Answer Checked By - Timothy Miller (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing