Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

998
Visualizações
Node.js: Run multiple apps on the same server

I want to run multiple Node.js (Express) applications on the same server. I am aware of two different methods:

  1. Using a reverse proxy to redirect requests to applications listening on different ports. For example

    https://website.com/app1 --> https://localhost:1001 https://website.com/app2 --> https://localhost:1002

  2. Using express middleware to run the applications on the same port (Running multiple Node (Express) apps on same port):

app
  .use('/app1', require('./app1/index').app)
  .use('/app2', require('./app2/index').app)
  .listen(8080);

What are the advantages and disadvantages of these two methods?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The biggest drawback of running them on Express is that both applications will share Node. One server will handle both requests, so all your resources (Memory, CPU, especially since it's single threaded) will be shared. This also means that any security issues introduced in one app now affect both apps.

On the plus side, you only have 1 set of overheads if your physical server is small, even though that single node process shares its resources between 2 applications, your physical server only has to run one node process.

However, optimally, each application should have its own Node process. Separate concerns, security, packages, resources. When it comes to implementation, it allows you to scale them separately, which makes debugging easier.

Basically, unless you have a good reason not to, you should separate them into 2-node applications.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda