Answers for "change port in node express"

2

change port in npm start

npm run dev -- --port 8080
Posted by: Guest on March-23-2021
0

node express app.listen at specific port & host

const express = require('express');
const app = express();
app.listen('9000','0.0.0.0',()=>{
      console.log("server is listening on 9000 port");
})
Posted by: Guest on June-28-2021
-1

express get port from request

const proxyHost = req.headers["x-forwarded-host"];
const host ? proxyHost : req.headers.host;
Posted by: Guest on December-24-2020

Browse Popular Code Answers by Language