Home > OS >  Error: listen EADDRINUSE: address already in use :::5000 BUT dotnet server does let me run api in po
Error: listen EADDRINUSE: address already in use :::5000 BUT dotnet server does let me run api in po

Time:01-21

I know this error has been asked a million times but I believe that the answers are not the correct ones or are not the most efficient.

// import all libraries
const express = require('express');
const cors = require('cors');
const mongoose = require('mongoose');

const app = express();

require('dotenv').config();

// setup connections
mongoose.connect(process.env.MONGODB_URL)
    .then(() => console.log("Connected to DB            
  •  Tags:  
  • Related