Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
Mern stack project with linux why is collapse?

The project is working normally. But sometimes I try to enter the site after 1 week and the site cannot be reached. I provide control on the Linux side, the client and server side are working, but it says the site cannot be reached. I run the commands below, I stand up again, it gets better, and it happens again after 1 week. I put a logger for the server side, it doesn't get any errors. What could be the problem?

When I write these codes, I restart the system and start it again, and it works, then breaks down again after 1 week. 1.sudo service ssh restart 2.sudo systemctl restart nginx 3.pm2kill 4.pm2 start server.js 5.pm2 start npm -- start

  1. Backend and frontend are standing even though the site is down. [1]: https://i.stack.imgur.com/XYbdk.png
  2. Website view , [2]: https://i.stack.imgur.com/vKs33.png

BackEnd : NodeJs,Express,Mongo FrontEnd : React

This is my backend server.js

const express = require('express');
const mongoose = require('mongoose');
const morgan = require('morgan');
const bodyParser = require('body-parser');
const cors = require('cors');
const { readdirSync } = require('fs');
const logger = require('./logger');
require('dotenv').config();

// app
const app = express();

// db
mongoose
  .connect(process.env.DATABASE, {
    useNewUrlParser: true,
    useCreateIndex: true,
    useFindAndModify: false,
    useUnifiedTopology: true,
  })
  .then(() => console.log('DB CONNECTED'))
  .catch((err) => console.log('DB CONNECTION ERR', err));

// middlewares
app.use(morgan('dev'));
app.use(bodyParser.json({ limit: '2mb' }));
app.use(cors());

// routes middleware
readdirSync('./routes').map((r) => app.use('/api', require('./routes/' + r)));

// port
const port = process.env.PORT || 8000;

logger.error('error');
logger.warn('warn');
logger.info('info');
logger.verbose('verbose');
logger.debug('debug');
logger.silly('silly');

app.listen(port, () => {
  logger.info('app is running');
});


  [1]: https://i.stack.imgur.com/XYbdk.png
  [2]: https://i.stack.imgur.com/vKs33.png
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda