Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!