Loading...
Loading...
HTTP 500 Internal Server ErrorA 500 error means something went wrong on the server side. The server encountered an unexpected condition that prevented it from fulfilling the request. This is always a server-side bug.
The actual error will be in your server logs, not the HTTP response.
# View recent logs on Linux
journalctl -u your-service -n 100
# Nginx error log
tail -f /var/log/nginx/error.log
# PM2 logs
pm2 logsEnsure all async route handlers have proper error handling.
app.get('/api/data', async (req, res) => {
try {
const data = await fetchData();
res.json(data);
} catch (err) {
console.error(err);
res.status(500).json({ error: 'Internal server error' });
}
});