본문 바로가기

[LINUX/CENTOS] listen EADDRINUSE: address already in use :::5000

by tonyhan18 2022. 3. 29.
728x90

뭔가에 잡히었나보다.

 

걍 포트번호를 옮기어주자

 

const express = require("express");
const bodyParser = require("body-parser");
const mysql = require("mysql");

const app = express();
const port = process.env.PORT || 7000;

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

app.get("/", (req, res) => {
  res.send("hello, node!");
});

app.listen(port, () => console.log(`Listening on port ${port}`));
728x90